• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
+ 4

What is the difference between getchar () and getline () ?

And cin when we read line ?

stringsinput_string
11th Jan 2019, 1:04 PM
Zeshan Ahmed
Zeshan Ahmed - avatar
1 Answer
+ 1
This is a good answer for the gets: https://www.daniweb.com/programming/software-development/threads/444375/getline-vs-getchar string s; cin >> s; Only reads to the first whitespace character so words from the line.
11th Jan 2019, 4:29 PM
John Wells
John Wells - avatar

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
How to start learning Python programming?
3 Votes
Where is the bug?
3 Votes
im beginner
2 Votes
Is code generated by chat GPT plagiarism?
1 Votes
How to fix this i feel something off
1 Votes
Pointers cpp
2 Votes
Is it possible to convert .zip file to apk? If yes, how??
1 Votes
How to add two strings together in ts or css
1 Votes
I think the heart system is ridiculous, 5 hearts that refill after like 5 hours? That is really just crazy to me.
1 Votes
Need Guidance: AI Tools for Creating an App Prototype & UI/UX Design
1 Votes