fork(4) download
  1. # include <iostream>
  2.  
  3. template <typename T>
  4. class C
  5. {
  6. public:
  7. static int n;
  8. };
  9.  
  10. int main()
  11. {
  12. C<int>::n = 10;
  13. C<float>::n = 0;
  14. std::cout << C<int>::n << std::endl;
  15. std::cout << C<float>::n << std::endl;
  16. return 0;
  17. }
  18.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/bin/ld: /home/7O8klK/ccl40RgM.o: in function `main':
prog.cpp:(.text.startup+0x12): undefined reference to `C<int>::n'
/usr/bin/ld: prog.cpp:(.text.startup+0x1c): undefined reference to `C<float>::n'
/usr/bin/ld: prog.cpp:(.text.startup+0x33): undefined reference to `C<float>::n'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty