fork download
  1. #include <stdio.h>
  2.  
  3. class X {
  4. public:
  5. int ns[];
  6. };
  7.  
  8. int main(void) {
  9. X x;
  10. x.ns = new int[10];
  11. return 0;
  12. }
  13.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:10:7: error: incompatible types in assignment of ‘int*’ to ‘int [0]’
  x.ns = new int[10];
       ^
stdout
Standard output is empty