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;
                
        a.Print();
         
        system ("pause");
        return 0; 
}

Never mind. I figured it out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.