Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int **a = NULL;
- int *b = NULL;
- int n = 5;
- int m = 10;
- int count = 0;
- a = new int * [n];
- for (int i = 0; i < n; i++) {
- a[i] = new int [m];
- for (int j = 0; j < m; j++) {
- a[i][j] = count++;
- }
- }
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < m; j++) {
- cout << a[i][j] << "\t";
- }
- cout << endl;
- }
- b = (int *)a;
- cout << "Hello: " << a[3][0] << endl;
- cout << "Hello 1: " << b[3] << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement