C++ Array accessed with pointer notation

Description

C++ Array accessed with pointer notation

#include <iostream>
using namespace std;
int main()/*ww w.j av a 2 s.  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;
}



PreviousNext

Related