I thought I had this program licked and moved on to fixing the next problems, then ran it again and found out my while loop isn't doing anything. It goes into my loop, stops, and doesn't do anything else. If there was one item, it should move on to the next function which tells what the length is, but I'm getting nothing. Just a black screen that says "Hey" once and then a flashing cursor. (The 'Hey' is my test, not part of the program.)

I'm using a class called List for this program in case that helps in diagnosing the issue.

int main ()
{      ItemType element;
        List a;
        ifstream InData;
        InData.open ("int.dat");
            while (InData >> element)  
                   { a.Insert(element);
                     cout << "Hey" << endl; }   
        int length = a.Length();
        cout << "There are " << length << " many items in this list." << endl;
        system ("pause");
        return 0; 
9 Years
Discussion Span
Last Post by DemonGal711
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.