It's because that the memory space (where "hello" is stored) that pointer[0] points to is not specified.
try this:
void main()
{
char *pointer[10];
pointer[0] = new char [10];
strcpy(pointer[0], "hello");
printf("%s", pointer[0]);
delete [] pointer[0];
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.