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

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -