i have declared 3 vars in my program
int a=10;
float b=123.4;
char c='a';
am trying to print the address of above three vars,for int and float am able to get the address how do i get the address of char variable.
cout<<&a; //for getting address of int varible
cout<<&b; //for getting address of float varible
when am saying cout<<&c
it is giving me the content of c i.e., a but not the address how do i get the address of char varible
@gungurthisrilatha
Or use printf()
1 2
|
char ch = 'a';
printf("%p",&ch);
|
Last edited on