473,385 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

cin does not take in two words in C++

I was using cin to get one word in my program when a user enters from a keyboard. Now, I need to get two words from a user inputing from a keyboard, but the cin >> statement does not work? Any ideas.....please help me - CTYD
Mar 1 '08 #1
2 1572
I found it. You put cin.ignore(); before a getline to make it pick up two words. It was buried on the internet- CTYD
Mar 1 '08 #2
sicarie
4,677 Expert Mod 4TB
Glad you figured it out, thanks for posting your answer.

Sorry we couldn't help you this time (props for figuring it out yourself, though); feel free to post again if you get stuck on something else!
Mar 1 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: John MacIntyre | last post by:
Hi, I need to populate a dictionary table with all the words in the English language. My first idea was to load a MSWord COM object and use the dictionary, but I would prefer to have my own...
24
by: David Mathog | last post by:
If this: int i,sum; int *array; for(sum=0, i=0; i<len; i++){ sum += array; } is converted to this (never mind why for the moment):
19
by: James Harris | last post by:
My K&R 2nd ed has in the Reference Manual appendix, A7.4.8 sizeof yields the number of BYTES required to store an object of the type of its operand. What happens if C is running on a machine that...
14
by: John Coleman | last post by:
Greetings, I am currently trying to learn Python through the excellent "Learning Python" book. I wrote my first non-trivial program, which began with several comment lines. One of the comment...
34
by: NewToCPP | last post by:
Hi, Why does a C/C++ programs crash? When there is access to a null pointer or some thing like that programs crash, but why do they crash? Thanks.
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
10
by: RickMuller | last post by:
One of my all-time favorite scripts is parseline, which is printed below def parseline(line,format): xlat = {'x':None,'s':str,'f':float,'d':int,'i':int} result = words = line.split() for i...
1
by: arnuld | last post by:
this is "word counting" example programme from K&R2 section 1.5.4. it runs without any error/warning but does not work properly, i.e. the OUTPUT 1 should be: NEWLINES: 1 WORDS: 1 CHARs: 5
12
by: Nelluru | last post by:
Hi, I am using Office XP PIA's to read a word document. I am able to read the whole content. The problem is that i want to get a particular word in the document instead of the whole content. ...
6
by: lawrence k | last post by:
Wierd. Go to this page: http://www.ihanuman.com/search.php and search for "yoga" This query gets run: SELECT * FROM albums WHERE MATCH(name,description) AGAINST ('yoga') ORDER BY id DESC
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.