Search

Theseus

How to print variable address


Source Code
#include <stdio.h>

int main(void)  
{
int i = 999;
int *cool = &i; 
printf("%d\n", i); // 32 bits
printf("0x%p\n", &i); 

printf("%d\n", *cool); 
printf("0x%p\n", &cool); 

return 0;
}

No comments:

Post a Comment