variable names of c/cpp

Status
Not open for further replies.
hello people,

I was thinking about :rolleyes: pointers that would retrieve the variable name and NOT the value....
i know that after compiled the prg does not have any var name.
but if i want to write a prg like

int a=2,b=3,sum;
sum=a+b;
cout<< THE VAR NAME "sum" <<sum;

even if the program is compiled int he debug mode
basically want to understand how var names are stored in c/c++;
 

dheeraj_kumar

Legen-wait for it-dary!
basically want to understand how var names are stored in c/c++;

Its very simple to understand. Variable names are NOT stored in the compiled program. Its all memory locations. So you cant do what you want to do.
 
Status
Not open for further replies.
Top Bottom