0
What are other input functions than cin?
I am making a program, where I take user input. Sadly, I need something like fgets() in C. Is there something like it?
5 Answers
+ 3
#include <string>
..then..
string word;
getline(cin, word);
..or...if it's a c-style string then..
char name[100];
cin.getline(name, 100);
+ 1
What the bloody hell. Why didn't they tell me that...
NOPE, just a barrage of errors
0
I am using fgets() right now, but it just doesn't ask for input.
https://code.sololearn.com/c1A15A24A17a/?ref=app