• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 174
  • Last Modified:

Using cin...urgent!

I am using cin to capture input.  What if the user doesn't enter anything and just hits return?  It won't break out of that.  How do I return an error?
0
jewee
Asked:
jewee
1 Solution
 
Harisha M GCommented:
Hi jewee,
    What do you want to read ? A character, integer, string or what ??

Try this:
    cin.get(a,'\n');


Bye
---
Harish
0
 
jeweeAuthor Commented:
Thanks!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now