@
thomaswang 随机值不是说每次都会生成不同的值,而是内存里正好是什么,就是什么。要是正好是 0,那就一直是 0,但是也可能是别的什么东西。比如以下代码:
#include <stdio.h>
int main() {
int id01, id02, id03, id04, id05, id06, id07, id08, id09, id10, id11, id12, id13, id14, id15, id16, id17, id18, id19, id20, id21, id22, id23, id24, id25, id26, id27, id28, id29, id30;
printf("id01..10 = %08X %08X %08X %08X %08X %08X %08X %08X %08X %08X\n", id01, id02, id03, id04, id05, id06, id07, id08, id09, id10);
printf("id11..20 = %08X %08X %08X %08X %08X %08X %08X %08X %08X %08X\n", id11, id12, id13, id14, id15, id16, id17, id18, id19, id20);
printf("id21..30 = %08X %08X %08X %08X %08X %08X %08X %08X %08X %08X\n", id21, id22, id23, id24, id25, id26, id27, id28, id29, id30);
return 0;
}
~# ./test
id01..10 = 00000000 00000000 00007FFC 23F86F40 0000560F 992EE580 0000560F 992EE790 00000000 00000000
id11..20 = 00000000 00000000 0000560F 992EE7DD 00000000 00000001 00007FCE FAA51FCA 00007FFC 23F86E3E
id21..30 = 00007FFC 23F86E3F 00000000 000000C2 00000000 00000000 00000000 00000000 00000000 00000000
~# ./test
id01..10 = 00000000 00000000 00007FFD A71865E0 00005635 4A21F580 00005635 4A21F790 00000000 00000000
id11..20 = 00000000 00000000 00005635 4A21F7DD 00000000 00000001 00007F38 76647FCA 00007FFD A71864DE
id21..30 = 00007FFD A71864DF 00000000 000000C2 00000000 00000000 00000000 00000000 00000000 00000000
~# ./test
id01..10 = 00000000 00000000 00007FFD 5A537250 0000564B D6EC8580 0000564B D6EC8790 00000000 00000000
id11..20 = 00000000 00000000 0000564B D6EC87DD 00000000 00000001 00007EFD 9C7E5FCA 00007FFD 5A53714E
id21..30 = 00007FFD 5A53714F 00000000 000000C2 00000000 00000000 00000000 00000000 00000000 00000000
~#