cin and cout work with char array : Array « Data Structure « C++






cin and cout work with char array

cin and cout work with char array
 

#include <iostream>
using namespace std;

int main ()
{
   char name[ 80] = {'J', 'e', 'f', 'f', '/0' };
   cout << "Enter your name: ";
   cin >> name;
   cout << "Your name is " << name;
   return 0;
}

           
         
  








Related examples in the same category

1.Using a Variable Pointer to Point to an ArrayUsing a Variable Pointer to Point to an Array
2.Array InitializationArray Initialization
3.Assigning and Displaying Array ValuesAssigning and Displaying Array Values
4.Using the cin and cout Objects with ArraysUsing the cin and cout Objects with Arrays
5.Outputs addresses and values of array elements.Outputs addresses and values of array elements.
6.To input numbers into an array and output after.To input numbers into an array and output after.
7.Array based on int pointer