So, as follows I have a basic while loop. It's working fine, however whenever I enter something other than a number or EoF, it goes through the loop one time after I'm wanting it to stop. Say I enter 5, then EoF, it enters an extra 5, so I have two entries of fives.

while(std::cin){
    std::cin >> numberinput;
    LinkedList.InsertFront(numberinput);
  }

Almost positive I'm overlooking something simple, but all help is appreciated

try this :)

while(std::cin >> numberinput){
    //std::cin >> numberinput;
    LinkedList.InsertFront(numberinput);
}
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.