Char *

Hi,
I was just wondering about this, Char * s = "aaaaa" is valid, it creates a pointer to char and also points to "aaaaa". But why doesn't int * p = 45 work?.

Because "aaaaa" is a pointer to a block of memory that contains aaaaa. That's what double-quoted data is: a char*. 45, however is a plain integer.

-Albatross
Topic archived. No new replies allowed.