Asking for the your Name and store in char array - C++ Data Type

C++ examples for Data Type:char array

Description

Asking for the your Name and store in char array

Demo Code

#include <iostream> 
  
using namespace std; 
  
int main(int argc, char *argv [])
{ 
        cout << "What is your name?" << endl << endl; 
  
        char playerName[1024]; 
        cin >> playerName; //from w w w  . j a  v  a2  s  .  c  o  m
  
        cout << endl << "Hello " << playerName << endl; 
  
        return 0; 
}

Result


Related Tutorials