User Tools

Site Tools


c_-_c_pointers:pointer

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.txt · Last modified: 2020/07/15 10:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki