Get char array with cin.getline : string read « String « C++






Get char array with cin.getline

   
#include <iostream>
#include <string.h>
using namespace std;
int main(void)
 {
   char string[256];

   while (cin.getline(string, sizeof(string), '\n'))
     cout << strupr(string) << '\n';
 }
  
    
    
  








Related examples in the same category

1.Use cin to read string
2.Input a string via cin.
3.Ask for a person's name, and generate a framed greeting