I keep getting a LNK 2019 error and a 1120 error and I can't figure out why. I have created other projects, new source files, and retyped it, but I can't fix it. I'm using visual studio 2013
#include<iostream>
#include<fstream>
usingnamespace std;
void read(int[], ifstream&);
void push(int[], int);
int pop(int[]);
int top = -1;
int main()
{
int myStk[100];
ifstream inFile;
inFile.open("postFix.txt");
read(myStk, inFile);
return 0;
}
void read(int myStk[], ifstream &inFile, int &i)
{
int num;
char hold;
int total = 0;
inFile >> num;
push(myStk, num);
inFile.get(hold);
while (hold != '\n')
{
if (hold == ' ')
{
}
elseif (hold == '*')
{
total = total + (pop(myStk)*pop(myStk));
}
elseif (hold == '+')
{
total = total + (pop(myStk) + pop(myStk));
}
elseif (hold == '-')
{
total = total + (pop(myStk) - pop(myStk));
}
inFile >> num;
push(myStk, num);
inFile.get(hold);
}
}
void push(int myStk[], int v)
{
top = top + 1; //increment top to the next available location in the array.the first push top will be 0.
myStk[top] = v; // this puts the value on the stack
return;
}
int pop(int myStk[])
{
int temp;
temp = myStk[top];
top--;
return temp;
}