fork download
  1.  
  2. static size_t COUNTER = 0;
  3.  
  4. size_t Counter()
  5. {
  6. return ++COUNTER;
  7. }
  8.  
  9. void ResetCounter()
  10. {
  11. COUNTER = 0;
  12. }
  13.  
  14. size_t CounterValue()
  15. {
  16. return COUNTER;
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:8: error: ‘size_t’ does not name a type
 static size_t COUNTER = 0;
        ^
prog.cpp:4:1: error: ‘size_t’ does not name a type
 size_t Counter()
 ^
prog.cpp: In function ‘void ResetCounter()’:
prog.cpp:11:2: error: ‘COUNTER’ was not declared in this scope
  COUNTER = 0;
  ^
prog.cpp: At global scope:
prog.cpp:14:1: error: ‘size_t’ does not name a type
 size_t CounterValue()
 ^
stdout
Standard output is empty