fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void x(int y[10])
  5. {
  6. cout << y << endl;
  7. cout << &y << endl;
  8. }
  9.  
  10. int main() {
  11. int a[10];
  12. cout << a << endl;
  13. cout << &a << endl;
  14. cout << &a[0] << endl << endl;
  15.  
  16. x(a);
  17. cout << endl;
  18. x(&a);
  19.  
  20. return 0;
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:18: error: cannot convert ‘int (*)[10]’ to ‘int*’ for argument ‘1’ to ‘void x(int*)’
stdout
Standard output is empty