[LCP]Printing a Variables Value..!!!
J.Mohamed Zahoor
zahoor at midascomm.com
Fri Jun 20 20:02:01 UTC 2003
Hi Greg..
Iam afraid that this query does not seek clarification from the FAQ
you have indicated...Perhaps you may have to look at the question
once again ....
main()
{
int aaa =10, bbb =20, ccc =30;
char varName[20];
memset(varName,0,20);
printf ("Enter any variable name\n");
gets(varName); /* Assume i entered aaa */
Do something here to print the value of aaa
without implementing additional data structures
like constructing a jump table that maps variable
name string with that variables address...
}
This can be done by searching the symbol table with the
variables name... But that is too cumbersome.. is there
a simple way to do this...!!!!
Anyway thanx for ur reply GREG...!!!
./zahoor
> See the comp.lang.c FAQ at:
>
> http://www.eskimo.com/~scs/C-faq/top.html
>
> It will give you a hint about handling this.
>
> And always read the FAQ before asking questions like this.
>
> Greg
> _______________________________________________
> This is the Linux C Programming List
> : http://lists.linux.org.au/listinfo/linuxcprogramming List
More information about the linuxCprogramming
mailing list