Why does the cursor jump straight to address and not name ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why does the cursor jump straight to address and not name ?

https://code.sololearn.com/crDINRXl8QoL/?ref=app

28th Feb 2018, 2:27 AM
Timew2
Timew2 - avatar
5 Answers
+ 5
This is as getline is always skipped when a cin>> call precedes it, as the cin>> call leaves a newline in the buffer which skips getline as well. Just add the following before your getline call : cin.ignore(); This deletes the last character from the buffer. https://www.sololearn.com/discuss/372045/?ref=app
28th Feb 2018, 2:56 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 1
Also , I'm using the DEV C++ complier to do it
28th Feb 2018, 2:42 AM
Timew2
Timew2 - avatar
+ 1
Thank you but I'm not done yet For the name I just declared a variable..... String name;
28th Feb 2018, 2:44 AM
Timew2
Timew2 - avatar
+ 1
Alright, Thanks . can I send you the assignment so you can have an idea of what doing ?. email ? (fast and easy
28th Feb 2018, 2:53 AM
Timew2
Timew2 - avatar
+ 1
kudos. it worked
28th Feb 2018, 3:06 AM
Timew2
Timew2 - avatar