How to print the value of a pointer in C

1 Answer

0 votes
#include <stdio.h>
 
int main() {
    int n = 9398;
    int *p = &n;
     
    printf("%p\n", p);
    printf("%p", &n);
    
    return 0;
}
 
 
 
 
/*
run
 
0x7ffe30f42bcc
0x7ffe30f42bcc
 
*/

 



answered May 1, 2021 by avibootz

Related questions

...