Microsoft
Software
Hardware
Network
Question : C++ Assigne multi word input into single string fiield
To assign a string field a multi word string (with spaces) from a file you can use a delimeter.
But how do you get multi word input into a single string from the console?
For example:
Please enter a product name: Product A
I would like to assign "Product A" to a single string
But if I use cin >> productName;
I will only get the first word of Product but the A will not be included.
Any help would be appreciated. Thanks!
Answer : C++ Assigne multi word input into single string fiield
Hm, that should not happen - can you try to explicitly specify a delimiter line
getline(cin,productName,'\
n');
or
char buf[255];
cin.getline(buf,255);
productName = buf;
?
(sorry, have to be offline for a little while now)
Random Solutions
How do I recover from a XP pro reinstall power failure
ASA 5505 DMZ won't Access Internet
Vista - "Open With" Not Allowing An Associated Program To Be Selected By Browsing
Exchange 2010 EWS Virtual Directory
Remote connectivity to Microsoft OCS 2007 R2 Fails
AAA server not on inside interface
Group Policy settings for BitLocker startup options are in conflict
Connect to exchange using FVS318 VPN Firewall
C# 2005 how to Change the Target .NET Framework Version of an Existing Project
Can plz anyone help for Jboss Clustering