fork(1) download
  1. #ifndef STACK_H
  2. #define STACK_H
  3.  
  4. class Stack{
  5. private:
  6. int size;
  7. int stack[size];
  8. public:
  9. void push(int x);
  10. int pop();
  11. }
  12.  
  13. #endif
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:6:6: error: invalid use of non-static data member 'Stack::size'
  int size;
      ^
prog.cpp:7:12: error: from this location
  int stack[size];
            ^
prog.cpp:11:1: error: expected ';' after class definition
 }
 ^
stdout
Standard output is empty