Using Microsoft visual c++ I have this program. I want to read in expressions line by line and produce output just as it does, but with expressions from a file. How would I do this? Also where would I place the input file for it to be read in? I am more familiar with java not C++.
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#include "expression.h"
#include "subexpression.h"
#include "symboltable.h"
#include "parse.h"
SymbolTable symbolTable;
void parseAssignments();
int main()
{
Expression* expression;
char paren, comma;
cout << "Enter expression: ";
cin >> paren;
expression = SubExpression::parse();
cin >> comma;
parseAssignments();
cout << "Value = " <<(int) expression->evaluate() << endl;
return 0;
}
void parseAssignments()
{
char assignop, delimiter;
string variable;
double value;
do
{
variable = parseName();
cin >> ws >> assignop >> value >> delimiter;
symbolTable.insert(variable, value);
} while (delimiter == ',');
}