Question about cout an stack object?
I created an object called MyRowstack form the class Rowstack
Code:
Rowstack MyRowstack; // Instantiate a Rowstack object;
and then I push some cards inside MyRowstack
Code:
for(int iCtr = 0; iCtr < 6; iCtr++)
{
MyRowstack.pushFaceDownCard(MyDeck[iCtr]);
}
If I want to cout the cards inside the object which I pushed in, what should I code?
I tried to code it like that:
Code:
for(iCtr = 0; iCtr < MyRowstack.size(); iCtr++)
{
cout << MyRowstack << endl;
}
I get this error code
Compiling...
rowstackTest.cpp
C:\Lab8\rowstackTest.cpp(20) : error C2039: 'size' : is not a member of 'Rowstack'
c:\lab8\rowstack.h(9) : see declaration of 'Rowstack'
Does anyone know what it is?
I think Stack supports object.size() operator.
Thanks.
I have some other questions posted in other topics, If it breaks the rules, pls remind me and sorry about that.