我的计算机上装有Windows,Linux和FreeBSD。但是偶然地,我“忘记了”在磁盘末端分配17 gb的可用磁盘空间(“坏”的Windows使用了一个小的主还原分区。因此,我现在有4个主分区)。我可以调整FreeBSD分区的大小以捕获可用空间吗?有我的磁盘分区。
$ gpart show
=> 63 488397105 ada0 MBR (232G)
63 1985 - free - (992k)
2048 716800 1 ntfs (350M)
718848 313856000 2 ntfs (149G)
314574848 2046 - free - (1M)
314576894 83996674 3 ebr (40G)
398573568 27 - free - (13k)
398573595 52428726 4 freebsd [active] (25G)
451002321 37394847 - free - (17G) // Free space i wanna allocate
=> 0 83996674 ada0s3 EBR (40G)
0 29997058 1 linux-data (14G)
29997058 2028 - free - (1M)
29999086 …Run Code Online (Sandbox Code Playgroud) 我意识到,如果我将const int定义到c ++函数体中然后使用地址算法来改变常量的值(它在堆栈上,不是吗?).我有这个代码:
const int a = 10;
int b = 100;
int * c = &b;
c++;
cout << "&a: " << &a << endl;
cout << " c: " << c << endl;
*c = 100500;
cout << " a: " << a << endl;
cout << "*c: " << *c << endl;
Run Code Online (Sandbox Code Playgroud)
我得到了这个输出
&a: 0x7ffff63866a8
c: 0x7ffff63866a8
a: 10
*c: 100500
Run Code Online (Sandbox Code Playgroud)
因此,地址是相同的,但值是不同的.有人能解释一下这个结果吗?谢谢!ps我试过GCC,Clang和VS.