Skip to content

Instantly share code, notes, and snippets.

@maluramichael
Created December 9, 2013 09:07
Show Gist options
  • Save maluramichael/7869431 to your computer and use it in GitHub Desktop.
Save maluramichael/7869431 to your computer and use it in GitHub Desktop.
Array of pointers
#include <iostream>
using namespace std;
int main(){
int* pArr;
int arr[2] = {10,20};
pArr = arr;
int a = 20;
int b = 30;
int** ppArr;
ppArr = new int*[2];
ppArr[0] = &a;
ppArr[1] = &b;
cout << *ppArr[0] << " " << *ppArr[1] << endl;
cin.get();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment