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
Error string in catch block?
Webrequest POST
PowerPoint 2007 Printing issues - shadows and text boxes
Access 2003/2007 background colour
Blackberry Enterprise Server - not sync contacts for one user?
Microsoft Virtual Environment - SQL Server 2005/SQL Server 2008
Deleting Unmatched Records MS Acess 2000
Access to OWA 2010 is very slow
circular logging for Exchange 2003 backend servers
Two SCCM primary site in active directory