I am trying to read in values from a data file. Everything compiles fine except when it gets to lol.GetNextItem(x); it says the x is undeclared identifier and undefined. I am not really sure how to fix it. I believe I attached the part of the code needed to address this but if the rest is needed, let me know.
class SortedList
{
private:
int length;
ItemType values[MAX_ITEMS];
int currentPos;
public:
void GetNextItem(ItemType &x);
}
void SortedList:: GetNextItem(ItemType &x)
{
currentPos++;
}
int main()
{
ifstream bug;
int i = 0;
int size = 0;
bug.open("num.dat");
float values[10];
while (!bug.eof())
{
bug >> values[i];
i++;
size++;
}
SortedList lol;
lol.GetNextItem(x);
bug.close();
return 0;
}