Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- void func(int **arr, int row, int col)
- {
- for (int i=0; i<row; i++)
- {
- for(int j=0 ; j<col; j++)
- {
- cout<<arr[i][j]<<" ";
- }
- printf("\n");
- }
- }
- int main()
- {
- int row=2, colum=3;
- int** arr = new int*[row];
- for(int i=0; i<row; i++)
- {
- arr[i] = new int[colum];
- }
- int k=1;
- for(int i=0;i<row;i++)
- {
- for(int j=0;j<colum;j++)
- {
- arr[i][j] = k;
- k++;
- }
- }
- func(arr, row, colum);
- return 0;
- }
Add Comment
Please, Sign In to add comment