Cin getline

Submitted by:David Villa

Date added:28 February, 2013

Category:C++

C++ Code example for Cin getline

Tags: getline

Code Snippet:

#include <iostream.h>

int main(void)
{
const SIZE = 100;
char msg[SIZE];
cout<<"Enter a string."<<endl;
cin.getline(msg,SIZE);
cout<<"The sentence you entered was"<<endl;
cout<<msg<<endl;

return 0;
}
 
 

Comments