Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. plz help!

plz help!

Scheduled Pinned Locked Moved Windows API
c++graphicsdata-structureshelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sahar111
    wrote on last edited by
    #1

    Hi everybody. Can anybody help me please? :confused: Define a virtual class stack to define the stack popular operations • size() • push() • pop() • peak() • isEmpty() • isFull() Derive two classes from the virtual stack class, call the first class vectorStack and the second class listStack, use STL vector and list classes to implement the two derived classes. i tried this one but it's not working, do anybody have suggestions please /////////////////////////////////////// #include #include #include using namespace std; template class stack { private: public: virtual type size(); virtual void push( type e); virtual void pop( type & e ); virtual void peak(); virtual bool isEmpty(); virtual bool isFull(); }; template class vector ::public stack { public: void push(type v) { v.push_back(); } void pop(type v) { v.pop_back(); } bool isEmpty(type v) { return(v.empty()); } bool isFull(type vector) { vector.capacity(); } type size(type vec) { vec.size(); } }; template class list::public stack { public: void push(type v) { v.push_back(); } void pop(type v) { v.pop_back(); } bool isEmpty(type v) { return(v.empty()); } bool isFull(type vector) { vector.capacity(); } type size(type vec) { vec.size(); } }; void main() { stack * vec= new vector(2); stack * lis= new list; vec.push(3); vec.push(4); int size=vec.size(); cout<

    H 1 Reply Last reply
    0
    • S Sahar111

      Hi everybody. Can anybody help me please? :confused: Define a virtual class stack to define the stack popular operations • size() • push() • pop() • peak() • isEmpty() • isFull() Derive two classes from the virtual stack class, call the first class vectorStack and the second class listStack, use STL vector and list classes to implement the two derived classes. i tried this one but it's not working, do anybody have suggestions please /////////////////////////////////////// #include #include #include using namespace std; template class stack { private: public: virtual type size(); virtual void push( type e); virtual void pop( type & e ); virtual void peak(); virtual bool isEmpty(); virtual bool isFull(); }; template class vector ::public stack { public: void push(type v) { v.push_back(); } void pop(type v) { v.pop_back(); } bool isEmpty(type v) { return(v.empty()); } bool isFull(type vector) { vector.capacity(); } type size(type vec) { vec.size(); } }; template class list::public stack { public: void push(type v) { v.push_back(); } void pop(type v) { v.pop_back(); } bool isEmpty(type v) { return(v.empty()); } bool isFull(type vector) { vector.capacity(); } type size(type vec) { vec.size(); } }; void main() { stack * vec= new vector(2); stack * lis= new list; vec.push(3); vec.push(4); int size=vec.size(); cout<

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      Does your question relevant to Vista and then when post a code use of pre tags

      pre


      WhiteSky


      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups