fork download
  1.  
  2. #include <iostream>
  3. #include <math.h>
  4. #include <time.h>
  5. #include<iomanip>
  6. #include<array>
  7. #include <algorithm>
  8.  
  9. using namespace std;
  10. const int AS = 6;
  11. void FillingRandomly(int (*)[AS]);
  12. void printing(int (*)[AS]);
  13.  
  14.  
  15. int c;
  16.  
  17. int main()
  18.  
  19. {
  20. int funny = 0;
  21. int timpa = 0;
  22. int counter = 0;
  23. int Array[AS][AS];
  24. srand(time(0));
  25.  
  26.  
  27. FillingRandomly(Array);
  28.  
  29.  
  30. cout << "The unsorted array is" << endl << endl;
  31.  
  32. printing(Array);
  33.  
  34. cout << "The sorted array is" << endl << endl;
  35.  
  36. printing(Array);
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44. system("PAUSE");
  45.  
  46.  
  47. return 0;
  48.  
  49. }
  50.  
  51. void FillingRandomly(int *Array)
  52. {for(int i=0;i<AS;i++)
  53. {for (int j=0;j<AS;j++)
  54.  
  55. *Array[i][j]=rand()%87 +12;
  56.  
  57. }
  58. }
  59.  
  60. void printing(int *Array)
  61. {
  62. for(int i=0;i<AS;i++)
  63. {for (int j=0;j<AS;j++)
  64. {int counter = 0;
  65.  
  66. cout<<*Array[i][j];
  67.  
  68. if (*Array[i][j]%AS == 0)
  69. cout << endl << endl;
  70. }
  71. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:20:6: warning: unused variable ‘funny’ [-Wunused-variable]
  int funny = 0;
      ^
prog.cpp:21:6: warning: unused variable ‘timpa’ [-Wunused-variable]
  int timpa = 0;
      ^
prog.cpp:22:6: warning: unused variable ‘counter’ [-Wunused-variable]
  int counter = 0;
      ^
prog.cpp: In function ‘void FillingRandomly(int*)’:
prog.cpp:55:12: error: invalid types ‘int[int]’ for array subscript
 *Array[i][j]=rand()%87 +12;
            ^
prog.cpp: In function ‘void printing(int*)’:
prog.cpp:66:19: error: invalid types ‘int[int]’ for array subscript
  cout<<*Array[i][j];
                   ^
prog.cpp:68:19: error: invalid types ‘int[int]’ for array subscript
    if (*Array[i][j]%AS == 0)
                   ^
prog.cpp:64:7: warning: unused variable ‘counter’ [-Wunused-variable]
  {int counter = 0;
       ^
prog.cpp:71:1: error: expected ‘}’ at end of input
 }
 ^
stdout
Standard output is empty