Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 29th, 2012  |  syntax: None  |  size: 0.45 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Constructor for postfix string expression
  2. arithmetic_expression::arithmetic_expression(RPNstring input)
  3. {
  4.  
  5.  
  6. }
  7.        
  8. Tree::Tree(std::string input,Tree *leftSubTree,Tree *rightSubTree){
  9.   Op = input;
  10.   leftPtr = leftSubTree;
  11.   rightPtr = rightSubTree;
  12.   int num;
  13.   if (input == "+"|input == "-"|input == "*"|input == "/")
  14.     NodeType = TYPE_OPERATOR;
  15.   else if(std::istringstream(Op)>>num)
  16.     NodeType = TYPE_NUMBER;
  17.   else
  18.     NodeType = TYPE_VARIABLE;
  19. }