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...
User Profile
Collapse
-
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() ;
... -
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... -
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...
No activity results to display
Show More
Leave a comment: