Array accessed with pointer notation - C++ Data Type

C++ examples for Data Type:Array

Description

Array accessed with pointer notation

Demo Code

#include <iostream>
using namespace std;
int main()/*w  ww .j a va  2s . c  o  m*/
{                                       //array
    int intarray[5] = { 3, 4, 7, 5, 3 };
    for(int j=0; j<5; j++)                  //for each element,
       cout << *(intarray+j) << endl;       //print value
    return 0;
}

Result


Related Tutorials