C++ pointers char -
what happens after running code?
char* c= "abc"; void* p= &c; printf("%s %s", *(char**) p, *(char*) p);
so c points string , p too. don't * do. can explain me?
the second argument in printf line causes problem, because interpret content of p string, rather pointer string. printf line be:
printf("%s %c", *(char**)p, *c);
Comments
Post a Comment