Using get() with a Character Array : cin get « Console « C++






Using get() with a Character Array

  
#include <iostream>
using namespace std;
int main()
{
   char stringOne[256];
   char stringTwo[256];

   cout << "Enter string one: ";
   cin.get(stringOne,256);
   cout << "stringOne: " << stringOne << endl;

   cout << "Enter string two: ";
   cin >> stringTwo;
   cout << "StringTwo: " << stringTwo << endl;
   return 0;
}
  
    
  








Related examples in the same category

1.Concatenate get() with Parameters
2.Using get() with no parameters.
3.Using get() with parameters.
4.Using get() with No Parameters to read single char
5.Using get() with Parameters to read single char in