User Profile

Collapse

Profile Sidebar

Collapse
n355a
n355a
Last Activity: Oct 26 '06, 02:44 PM
Joined: Oct 1 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • n355a
    started a topic Polymorphism help...
    in C

    Polymorphism help...

    hi everyone....if anyone has time...

    can anyone help me with virtual functions...

    I have class student, Graduate, Undergraduate. There's a printInfo() in each class, and the one in student is made pure virtual. I had to create a vector of students that had a combination of Graduates and Undergraduates in main. Then I had to pass the vector to a function. In that function theres a loop that goes through each students...
    See more | Go to post

  • n355a
    started a topic Vector of Pointers??
    in C

    Vector of Pointers??

    Can anyone please give me a brief explanation as to how this vector is suppose to work. (vector<Grocery Item*> gitems; )

    Here are the classes...

    class Inventory

    {

    protected:

    vector<GroceryI tem*> gitems;

    public:

    void AddNewGrocery() ;

    void DeleteGrocery() ;

    ...
    See more | Go to post

  • n355a
    replied to Operation Overloading
    in C
    Thanks for the help but when i call the PrintQ function how does it know to also call the ostream& operator<< function???


    template <class T>
    void Queue<T>::Print Q()
    {

    cout << “The content of the array is as follows: ” << endl;

    }



    ostream& operator<<(ostr eam& os, PrintQ& theQ)
    {
    for...
    See more | Go to post

    Leave a comment:


  • n355a
    started a topic Operation Overloading
    in C

    Operation Overloading

    How would I overload the cout (<< ) operator in this function???

    template <class T>
    void Queue<T>::Print Q()
    {

    cout << “The content of the array is as follows: ” << endl;

    for (int i=0; i< theQ.size(); i++)

    cout << theQ[i] << endl;
    }


    i tried to follow an example and came up with this... but i don't think...
    See more | Go to post
No activity results to display
Show More
Working...