array initialization is not 0

2017-10-15  本文已影响0人  Programming

#include#define page_size 1<<12

int main(void)

{

int array_size;

// must be explicit initialized

char zero_page[page_size];

array_size = sizeof(zero_page)/sizeof(*zero_page);

for (int i = 0; i < array_size; i++)

printf("the value in %dth char array %d\n", i, zero_page[i]);

}

上一篇下一篇

猜你喜欢

热点阅读