fork download
  1. class Helloworld{
  2. public:
  3. static int x;
  4. void foo();
  5. };
  6.  
  7. // uncomment to fix
  8. //int Helloworld::x;
  9.  
  10. void Helloworld::foo(){
  11. Helloworld::x = 10;
  12. };
  13.  
  14. int main() {
  15. return 0;
  16. }
Compilation error #stdin compilation error #stdout 0s 3336KB
stdin
Standard input is empty
compilation info
/home/PBjAw9/ccefhKg5.o: In function `Helloworld::foo()':
prog.cpp:(.text+0x2): undefined reference to `Helloworld::x'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty