Array Initialization : Array « Data Structure « C++






Array Initialization

Array Initialization
 

#include <iostream>

using namespace std;

int main ()
{
   char name[ ] = {'J', 'e', 'f', 'f', '/0' };

   cout << 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.Assigning and Displaying Array ValuesAssigning and Displaying Array Values
3.Using the cin and cout Objects with ArraysUsing the cin and cout Objects with Arrays
4.cin and cout work with char arraycin and cout work with char array
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