char * test = \"test\"; cout << sizeof(test); char test2[] = \"test\"; cout << sizeof(test2);
Running this on visual studio 2010, why
The first one displays the size of the pointer, not the array. In the second case, you are displaying the size of the array.