char c[] = \"Hello\";
char *p = \"Hello\";
printf(\"%i\", sizeof(c)); \\\\Prints 6
printf(\"%i\", sizeof(p)); \\\\Prints 4
My question is:
Why
"sizeof" is the directive of the compilers. The result indicates the size in memory that the argument occupies. Compiler is reseponsible for determining the result according to the argument's type. Regarding the "array", returns the array size. moreover, the pointer returns "4" generally speaking for 32-bit machine.