char * test = \"test\"; cout << sizeof(test); char test2[] = \"test\"; cout << sizeof(test2);
Running this on visual studio 2010, why
on a 32-bit system, the size of a pointer is 32 bits or 4 bytes and therefore, size of test is 4. On the other side, test2 is an array with a NUL terminating character and it's size is 5.