G
Guest
I'm currently using the following statements inside "Do.. While" loop
cout << "Please enter the file name: ";
cin.getline(FileName, 19, '\n')
On the first execution, everything works ok, but when the 'while' condition is met and it goes back to the beginning of the while loop to execute the statement again, it won't stop for user input any more. (That is before cin.getline(FileName, 19, '\n'); ) The code fails because it can't read the input when it's being executed at the second time. Why is it happening
Should I code differently when I ask for user input inside loop
Thanks in advance for your help!!
cout << "Please enter the file name: ";
cin.getline(FileName, 19, '\n')
On the first execution, everything works ok, but when the 'while' condition is met and it goes back to the beginning of the while loop to execute the statement again, it won't stop for user input any more. (That is before cin.getline(FileName, 19, '\n'); ) The code fails because it can't read the input when it's being executed at the second time. Why is it happening
Should I code differently when I ask for user input inside loop
Thanks in advance for your help!!