Inputting Multiple Words into a String : String « Data Type « C++

C++
1. Bitset
2. Class
3. Console
4. Data Structure
5. Data Type
6. Deque
7. Development
8. File
9. Function
10. Generic
11. Language
12. List
13. Map Multimap
14. Overload
15. Pointer
16. Queue Stack
17. Set Multiset
18. STL Algorithms Binary search
19. STL Algorithms Heap
20. STL Algorithms Helper
21. STL Algorithms Iterator
22. STL Algorithms Merge
23. STL Algorithms Min Max
24. STL Algorithms Modifying sequence operations
25. STL Algorithms Non modifying sequence operations
26. STL Algorithms Sorting
27. STL Basics
28. String
29. Valarray
30. Vector
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
C++ » Data Type » StringScreenshots 
Inputting Multiple Words into a String
Inputting Multiple Words into a String

#include <iostream>
using namespace std;
#include <string>
int main(void)
{
   string name;
   cout << "Enter your name: ";
   cin >> name;
   cout << "Your name is " << name;
   return 0;
}

           
       
Related examples in the same category
1. String type classString type class
2. A filter to remove white-space characters at the ends of lines.A filter to remove white-space characters at the ends of lines.
3. A string demonstration: assignment, concatenate, compareA string demonstration: assignment, concatenate, compare
4. Demonstrate insert(), erase(), and replace().Demonstrate insert(), erase(), and replace().
5. Use string: find, string::nposUse string: find, string::npos
6. Strings: size, iterator, count, begin and endStrings: size, iterator, count, begin and end
7. string: find( ) and rfind( )string: find( ) and rfind( )
8. Print a name in two different formatsPrint a name in two different formats
9. Several string operations: substrSeveral string operations: substr
10. String Char IndexingString Char Indexing
11. String Find and replaceString Find and replace
12. String SizeString Size
13. String SizeOfString SizeOf
14. A short string demonstrationA short string demonstration
15. String insert(), erase(), and replace()String insert(), erase(), and replace()
16. string variable instead of a character arraystring variable instead of a character array
17. Adding StringsAdding Strings
18. Read string from consoleRead string from console
19. Insert, search, and replace in strings.Insert, search, and replace in strings.
20. Accessing Characters In StringsAccessing Characters In Strings
w___w__w___.__j_a__v__a_2___s__._c__om_ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.