c++ - evaluating a string in a condition -


how work string evaluate numbers coming condition?

string = "(t>=2 && t<5) || (t<1)";  int c = 0; for(int t = 0; t < 10; t++){     if(  {string} )         c++; } 

if it's qt write like

qscriptengine e; e.globalobject().setproperty("t", 123);  bool result = e.evaluate("(t>=2 && t<5) || (t<1)").tobool(); 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -