User Tools

Site Tools


c_-_c_pointers:pointer

This is an old revision of the document!


C - C++ Pointers - Pointer

#include <iostream>
 
const int ARRAY_LENGTH = 5;
 
using namespace std;
 
int main ()
{
  int Numbers [ARRAY_LENGTH] = {0, 100, 200, 300, 400};
 
  const int *pInt = Numbers;
 
  for (int nIndex = 0; nIndex < ARRAY_LENGTH; ++ nIndex)
    cout << "Element [" << nIndex << "] = " << *(pInt + nIndex) << endl;
 
  return 0;
}
c_-_c_pointers/pointer.1507904963.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki