Array identifier is a read-only pointer to the beginning of an array. - C++ Data Type

C++ examples for Data Type:Array

Description

Array identifier is a read-only pointer to the beginning of an array.

Demo Code

#include <iostream>
using namespace std;
int main() {// www  .j  a  v  a  2  s.  co  m
   int a[10];
   cout << "a = " << a << endl;
   cout << "&a[0] =" << &a[0] << endl;
}

Result

Array Pointers And Brackets

int main() {
   int a[10];
   int* ip = a;
   for(int i = 0; i < 10; i++)
      ip[i] = i * 10;
}

Related Tutorials