Created
November 16, 2014 07:03
-
-
Save sid24ss/5d01f7f4661c49514111 to your computer and use it in GitHub Desktop.
triple pointers
This file contains hidden or 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() | |
| { | |
| cout << "Hello World" << endl; | |
| int*** a; | |
| a = new int**[10]; | |
| for (int i = 0; i < 10; i++) { | |
| a[i] = new int*[10]; | |
| for (int j =0; j < 10; j++) { | |
| a[i][j] = new int[10]; | |
| } | |
| } | |
| for (int i = 0; i < 10; i++) | |
| for (int j =0; j < 10; j++) | |
| for (int k = 0; k < 10; k++) | |
| a[i][j][k] = i*10 + j*10 + k; | |
| for (int i = 0; i < 10; i++) { | |
| for (int j =0; j < 10; j++){ | |
| for (int k = 0; k < 10; k++) | |
| cout << a[i][j][k] << "\t"; | |
| cout << endl; | |
| } | |
| cout << endl; | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment