How to get the address of a variable in C

1 Answer

0 votes
#include <stdio.h>

int main() {
    int n = 9;
    
    int* address_of_n = &n;
    
    printf("%p\n", address_of_n);
    printf("%p", &n);

    return 0;
}





/*
run:

000000DB03AFF994
000000DB03AFF994

*/

 



answered Nov 4, 2022 by avibootz

Related questions

1 answer 161 views
2 answers 145 views
1 answer 154 views
1 answer 160 views
160 views asked Nov 4, 2022 by avibootz
1 answer 136 views
1 answer 229 views
...