cin.getline problem

This is a discussion on cin.getline problem within the C++ Programming forums, part of the General Programming Boards category; If I use the cin.getline(aString,int something)command the program runs well on the first time but if i restart the program ...

cin.getline problem

If I use the cin.getline(aString,int something)command the program runs well on the first time but if i restart the program by f.e. calling main for the second time, the program skips the cin.getline.
What do I have to do to solve this problem?

>f.e. calling main for the second time
If you're allowed to do this then you're not using C++. Calling main recursively is illegal and results in a compile time error. It's allowed in C, but not a good idea.

Re: cin.getline problem

Originally posted by Ivan! If I use the cin.getline(aString,int something)command the program runs well on the first time but if i restart the program by f.e. calling main for the second time, the program skips the cin.getline.
What do I have to do to solve this problem?