I created an object called MyRowstack form the class Rowstack
and then I push some cards inside MyRowstackCode:Rowstack MyRowstack; // Instantiate a Rowstack object;
If I want to cout the cards inside the object which I pushed in, what should I code?Code:for(int iCtr = 0; iCtr < 6; iCtr++) { MyRowstack.pushFaceDownCard(MyDeck[iCtr]); }
I tried to code it like that:
I get this error codeCode:for(iCtr = 0; iCtr < MyRowstack.size(); iCtr++) { cout << MyRowstack << endl; }
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.



LinkBack URL
About LinkBacks



