Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

traverse string in cpp

// C++ program to demonstrate getline() function
 
#include <iostream>
#include <string>
using namespace std;
 
int main()
{
    string str;
 
    cout << "Please enter your name: 
";
    getline(cin, str);
    cout << "Hello, " << str
         << " welcome to GfG !
";
 
    return 0;
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #traverse #string #cpp
ADD COMMENT
Topic
Name
2+6 =