fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4.  
  5. void func(int **arr, int row, int col)
  6. {
  7. for (int i=0; i<row; i++)
  8. {
  9. for(int j=0 ; j<col; j++)
  10. {
  11. cout<<arr[i][j]<<" ";
  12. }
  13. printf("\n");
  14. }
  15. }
  16.  
  17.  
  18. int main()
  19. {
  20. int row = 2, column = 3;
  21.  
  22. int** arr = new int*[row];
  23.  
  24. for(int i=0; i<row; i++)
  25. {
  26. arr[i] = new int[column];
  27. }
  28.  
  29. int a[column] = {1, 2, 3}, b[column] = {4, 5, 6};
  30. arr[0] = a;
  31. arr[1] = b;
  32.  
  33. func(arr, row, column);
  34.  
  35. return 0;
  36. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
1 2 3 
4 5 6