fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void Display(int A[][20], int N, int M);
  5.  
  6. int main() {
  7. char name[] = {"alex", "ben"};
  8. Display(name);
  9. return 0;
  10. }
  11.  
  12. void Display(int A[][20], int N, int M)
  13. {
  14. for(int R = 0; R < N; R++)
  15. {
  16. for (int C = 0; C < M; C++)
  17. cout << A[R][C] << endl;
  18. }
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:7:30: error: too many initializers for ‘char []’
  char name[] = {"alex", "ben"};
                              ^
prog.cpp:8:14: error: cannot convert ‘char*’ to ‘int (*)[20]’ for argument ‘1’ to ‘void Display(int (*)[20], int, int)’
  Display(name);
              ^
stdout
Standard output is empty