|
-
Sep 26th, 2002, 09:34 PM
#1
Thread Starter
Member
easy *hopes* cin question
Hey,
I've been looking all over for this, but is there a way to cin an integer and ignore any other symbols i enter before or after it?
Like for ex:
int a,b;
cin >>a >>b;
if I enter "(3,4)". a is not 3, and b is not 4. Is there some kind of flag to set cin to only accept integers.
-
Sep 27th, 2002, 06:01 AM
#2
Monday Morning Lunatic
Um, no. Just read everything you want in succession (or use an expression parser...)
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|