S
spiros
Hi,
suppose you have the class Class1 and the main program:
class Class1
{
public:
Class1();
~Class1();
private:
int a;
int b;
}
void main()
{
Class1 cl = Class1();
cl.a = 4;
cl.b = 6;
char str[] = "a>0 && b<5"
}
I want to check if the expression which is contained to the str[] is
true or false.
With other word i want to check the following:
if (a>0 && b<5)
{
// do something
}
else
{
// do something else
}
the problem is that i have the expression in a string, how can i
convert the content od the string to a expression and check if the
expression is TRUE or FALSE?
Thanks in advance for any help.
suppose you have the class Class1 and the main program:
class Class1
{
public:
Class1();
~Class1();
private:
int a;
int b;
}
void main()
{
Class1 cl = Class1();
cl.a = 4;
cl.b = 6;
char str[] = "a>0 && b<5"
}
I want to check if the expression which is contained to the str[] is
true or false.
With other word i want to check the following:
if (a>0 && b<5)
{
// do something
}
else
{
// do something else
}
the problem is that i have the expression in a string, how can i
convert the content od the string to a expression and check if the
expression is TRUE or FALSE?
Thanks in advance for any help.