S
sinbad
how can i write a program, which should accept input as NAME of a
variable in the program and
print it's value.Is this possible. for example.
int main ()
{
int x,y,z;
x = 10;
y = 20;
z = 30;
wait_for_input();
print_output();
}
wait_for_input ()
{
do some thing to get input from user;
}
print_output()
{
do some thing to print output;
}
the user gives the following commands at runtime.
#print x --> it should print value of x
#print y --> it should print vlaue of y
The solution should work even for structure variables.
thanks
variable in the program and
print it's value.Is this possible. for example.
int main ()
{
int x,y,z;
x = 10;
y = 20;
z = 30;
wait_for_input();
print_output();
}
wait_for_input ()
{
do some thing to get input from user;
}
print_output()
{
do some thing to print output;
}
the user gives the following commands at runtime.
#print x --> it should print value of x
#print y --> it should print vlaue of y
The solution should work even for structure variables.
thanks