Hello everyone. What I am simply trying to do is to read two names that can contain spaces.
Here is my code:
I tested the same code inside main and it works normally but now, in this function something strange occurs. What I see when run the program isCode:void Foo :: Cinema { .... .... char title[20], director[20]; cout << "Give me the title :" << endl; cin.getline(title, 20, '\n'); cout << "Give me the director : " << endl; cin.getline(director,20, '\n'); .... }
and as a result I can put only the name of the director.Code:Give me the title : Give me the director : (cursor here)
What could be wrong? How can I fix this?
p.s. I use Visual Studio 2005