cin.getline() doesnt work | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

cin.getline() doesnt work

i was writing a long peice of code for a text based adventure game and i came across anwsers with more than 1 word, so i used: char irrev[256]; cin.getline(irrev, 256); and the blasted thing wont function like the normal cin would operate, i noticed it works with other files except specifically the one im writing at this moment.

16th Sep 2016, 2:41 PM
YourDamnSandwitch
YourDamnSandwitch - avatar
3 Answers
+ 2
use gets(irrev);
16th Sep 2016, 2:54 PM
Infinity
Infinity - avatar
0
it doesnt work it still wont let me type anything as if there was no "cin", but for some reason the normal cin command works fine, is it a bug in my IDE?
16th Sep 2016, 3:11 PM
YourDamnSandwitch
YourDamnSandwitch - avatar
0
cin.getline("hello workd")
16th Sep 2016, 4:25 PM
Zeeshan Saeed
Zeeshan Saeed - avatar