Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

getline

#include <bits/stdc++.h>
using namespace std;

int main()
{

#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
int t;
string a,b;
cin>>a;
cin.ignore();  /*must include this otherwise the cin will 
have null space availabe in buffer and getline wont take 
anything as input so we must clear or ignore the space 
availabe in buffer due to previous input */
getline(cin,b);

cout<<a<<b;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #getline
ADD COMMENT
Topic
Name
6+7 =