samedi 28 mars 2015

char * and integers, can you convert between?

why cant I do this:



char * p = (char *) 48;
printf("%d", p[0]); // why doesn't this give me 4


but I can do this:



char p = 48;
printf("%d", p);


thanks


Aucun commentaire:

Enregistrer un commentaire