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

Standard output is empty