Am I correct in saying that the above statment assigns 5 elements of type char on the heap and that all elements contain '\0' ?Code:char* p = new char[5];
I then add this line of code,
The above contains obviously more than 5 elements, does the compiler redefine the pointer an assign a big array ? does the compiler add '\0' at the end of the array ?Code:p = "this is my car";



LinkBack URL
About LinkBacks


