Q: How much memory does a pointer variable allocate?
A: That's a pretty misleading question. When you declare a pointer variable, as in
char *p;you (or, more properly, the compiler) have allocated only enough memory to hold the pointer itself; that is, in this case you have allocated sizeof(char *) bytes of memory. But you have not yet allocated any memory for the pointer to point to. See also questions 7.1 and 7.2.