12.07.2015 Views

C++ - VideoTutorials-bg.com

C++ - VideoTutorials-bg.com

C++ - VideoTutorials-bg.com

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

#include template struct elem{T inf;elem* link;};template class stack{public:stack();~stack();stack(stack const &);stack& operator=(stack const & r);void push(T const&);int pop(T & x);bool empty() const;void print();private:elem *start; // указател към шаблона на структурата elemvoid delstack();void copy(stack const&);};template stack::stack(){start = NULL;}template stack::~stack(){delstack();}template stack::stack(stack const & r){copy(r);}template stack& stack::operator=(stack const& r){if (this != &r){delstack();95

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!