char * test = "test";
cout << sizeof(test);
char test2[] = "test";
cout << sizeof(test2);
Running this on visual studio 2010, why is the output 45
?
Shouldn't test be a string literal and the sizeof
a string literal be the number of character elements in the string literal including the terminating null character?