I started learning C (so, you know .. pointers).
I have this code:
#include <stdio.h> #include <string.h> int main (int argc, char* argv[]) { char c = 'c'; char* cptr = &c; printf("c = %c\n", c); printf("*cptr = %c\n", *cptr); printf("c address = %p\n", &c); }
My conclusion:
c = c *cptr = c c address = 0x7fff0217096f
When I convert a hexadecimal digit to decimal, I get: 140720994002157
My questions:
1) Does this decimal value indicate a memory address? Isn't that too big?
2) How can I print the value of a pointer (which means the address of the variable c ) as a decimal?
c pointers memory-address
padawanTony
source share