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

matlab - Deleting rows with specific rules -

image - ClassNotFoundException when add a prebuilt apk into system.img in android -