OutputCode:int ibuf[5]; // or even int ibuf[5] = {1,2,3,4,5}; printf("Size of ibuf: %i\n", sizeof(ibuf));
Why? Is this the size of the array in bytes? How do I get the number of elements?Code:Size of ibuf: 20
Why then, does this return what I expect it to?
Output:Code:char cbuf[5] = "Hello"; printf("Size of cbuf: %i\n", sizeof(cbuf));
Code:Size of cbuf: 5