title: C++ infix to prefix conversion for logical conditions
body: <p>I want to evaluate one expression in C++. To evaluate it, I want the expression to be converted to prefix format.</p>
  
  <p>Here is an example</p>
  
  <pre><code> wstring expression = "Feature1 And Feature2";
  </code></pre>
  
  <p>Here are possible ways.</p>
  
  <pre><code> expression = "Feature1 And (Feature2 Or Feature3)";
  
   expression = "Not Feature1 Or Feature3";
  </code></pre>
  
  <p>Here <strong>And</strong>, <strong>Or</strong>, <strong>Not</strong> are reserved words and parentheses ("<strong>(</strong>", <strong>)</strong>) are used for scope</p>
  
  <p><strong>Not</strong> has higher precedence</p>
  
  <p><strong>And</strong> is set next precedence to Not</p>
  
  <p><strong>Or</strong> is set to next precedence to And</p>
  
  <p><strong>WHITE SPACE</strong> used for delimiter. Expression has <strong>no</strong> other elements like <strong>TAB</strong>, <strong>NEWLINE</strong> </p>
  
  <p>I <strong>don't</strong> need <strong>arithmetic</strong> expressions. I can do the evaluation but can somebody help me to convert the strings to prefix notation?</p>