Firstly, Sorry about my bad english. I wanna ask something that I expect amazing. I'm not sure this is amazing for everyone, but It is for me :) Let me give example code
char Text[9] = "Sandrine";
for(char *Ptr = Text; *Ptr != '\0'; ++Ptr)
cout << Ptr << endl;
This code prints
Sandrine
andrine
ndrine
drine
rine
ine
ne
e
I know it's a complicated issue in C++. Why İf I call Ptr to print out screen it prints all of array. However if Text array is a dynamic array, Ptr prints only first case of dynamic array(Text). Why do it happen? Please explain C++ array that how it goes for combination of pointing array.
thanks for helping.
const char *.new char("play")doesn't create an array! Instead, it should fail to compile: there is no way to construct acharfrom achar const*.