fork download
  1. //stack.h - definicja klasy stosu (wg ADT)
  2. #ifndef STACK_H_
  3. #define STACK_H_
  4.  
  5. typedef unsigned long Item;
  6.  
  7. class Stack
  8. {
  9. private:
  10. enum { MAX = 10}; //stała zasięgu klasy
  11. Item items[MAX]; //przechowuje elementy stosu
  12. int top; //indeks szczytowego elementu stosu
  13. public:
  14. Stack();
  15. bool isempty() const;
  16. bool isfull() const;
  17. //push() zwraca false, jeśli stos jest już pełen (true w pozostałych przypadkach)
  18. bool push(const Item & item); //odkłada element na stos
  19. //pop() zwraca false, jeśli stos jest już pusty (true w pozostałych przypadkach)
  20. bool pop(Item & item); //zdejmuje element ze stosu
  21. };
  22. #endif
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
stdout
Standard output is empty