C++ examples for Data Type:Array Pointer
Using a Pointer with an Array
#include <iostream> using namespace std; int main(int argc, char *argv []) { int intArray[5] = { 0, 1, 2, 3, 4 }; cout << "Value: " << *intArray << endl; cout << "Value: " << *(intArray + 1) << endl; cout << "Value: " << *(intArray + 2) << endl; cout << "Value: " << *(intArray + 3) << endl; cout << "Value: " << *(intArray + 4) << endl; return 0; }