fork download
  1.  
  2. #include "MixedExpression.h"
  3. #include<iostream>
  4. #include<fstream>
  5. using namespace std;
  6.  
  7. int main(int argc, char *argv[])
  8. {
  9. MixedExpression res;
  10. MixedExpression op1;
  11. MixedExpression op2;
  12. char symbol;
  13. long x,y;
  14. ifstream in;
  15. ofstream out;
  16.  
  17. if(argc > 1)
  18. {
  19. in.open(argv[1]); // Open input file on command line.
  20. if(in)
  21. {
  22. out.open(argv[2]); // Open output file on command line.
  23. while(!in.eof())
  24. {
  25. op1.ReadMixedExp(in); // Read first mixed expression.
  26. in >> symbol; // Read the symbol.
  27. op2.ReadMixedExp(in); // Read second mixed expression.
  28. switch(symbol)
  29. {
  30. case '+': res = op1.add(op2);
  31. break;
  32. case '-': res = op1.subtract(op2);
  33. break;
  34. case '*': res = op1.multiply(op2);
  35. break;
  36. case '/': res = op1.divide(op2);
  37. break;
  38. }
  39. op1.printData(out); // Print the first mixed expression.
  40. out << " " << symbol << " "; // Print the symbol.
  41. op2.printData(out); // Print the second mixed expression.
  42. out << " = ";
  43. res.printData(out); // Print the result.
  44. out << endl;
  45. }
  46. // Close the input file.
  47. in.close();
  48. // Close the output file.
  49. out.close();
  50. }
  51. }
  52. return 0;
  53. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:29: fatal error: MixedExpression.h: No such file or directory
 #include "MixedExpression.h"
                             ^
compilation terminated.
stdout
Standard output is empty