Created
December 9, 2013 09:07
-
-
Save maluramichael/7869431 to your computer and use it in GitHub Desktop.
Array of pointers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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