I cant seem to find the problem in this code...
when I try to use the trinode "root" or the iterator "currentIt" after this if statement, it keeps giving me errors saying they are not declared, which I would assume means it never gets past the IF(first <10) but If i cout << first right before, its 8.....which is obviously less than 10. If i remove the if statement it will work..but i NEED that statement for later code.
Code:
ifstream fin;
fin.open("C:/Users/Josh/Desktop/TriNode/NumList.txt");
int first;
fin >> first;
cout << first;
if(first < 10)
{
trinode root(first);
list<int>::iterator currentIt;
while(!fin.eof())
{
int temp;
fin >> temp;
root.insert_node(temp);
}
}
Comment