Thanks so much for it.
It makes my mind better. :p
Type: Posts; User: joenching
Thanks so much for it.
It makes my mind better. :p
1) I think I can create the objects from either the default constructor - apple and the one I can type the parameter - Applestack(int s, string str).
2) the methods - void display()
3)...
I don't really understand what you said.
For me, I realize if i create an object and insert elements inside the obects, then i can use a for loop to show each elements.
but the problem is i don't...
So, according the rules, so the object is not a stack object and it doesn't .empty() operator?
And If I want to cout the elements inside this object, what should I do?
Thanks for advance.
Can you give me some advice?
My idea is :
If (the object is empty)
{
throw an exception
}
else
returns the card at the top of the stack.
I created an object called MyRowstack form the class Rowstack
Rowstack MyRowstack; // Instantiate a Rowstack object;
and then I push some cards inside MyRowstack
for(int iCtr = 0;...
I have modified the rowstack.cpp again and I ignored the exception part.
//rowstack.cpp
#include <cstdlib>
#include <stack>
#include <iostream>
#include "rowstack.h"
#include "deck.h"...
I have remodified my code like that:
However it has 6 errors when i tried to compile it.
Here are the error code:
Compiling...
rowstack.cpp
c:\lab8\rowstack.cpp(13) : error C2039: 'push_back' :...
Hi all, when i tried to compile those files, my compiler told me that I have 3 errors
those errors are:
Compiling...
rowstackTest.cpp
c:\lab8\rowstacktest.cpp(17) : error C2065: 'faceDownCards' :...
Thanks Sir.
Coz i am gonna to throw an exception when the stack doesn't have card
So, for the code, Can I use that?
enum RowstackExceptions { RowstackEmpty };
what is that for the second link?
I am creating an ADT named RowstackException which inside the class, It should contain a public enumerated typed named RowstackExceptions. There will only be one value in the enumerated type:...
So Are you mean that:
Card Rowstack::popFaceDownCard()
{
return popFaceDownCards.top();
}
I am not sure which variable should be coded after the return.
I think I should use
Card::Card popFaceDownCard()
{
return card.top();
}
Here is my rowstack.cpp
//rowstack.cpp
#include <stack>
#include <iostream>
#include "rowstack.h"
using namespace std;
I am working on the solitaire game and I created an ADT called Rowstack. Inside the Rowstack, I have a function called
"Card popFaceDownCard()" which returns the card at the top of the stack and if...
I also created an method VALUETYPE getItem( const string& key ) const; inside the public
However, when I tried to compile it the HastTableTest.cpp, it shows I have 2 errors
Here is my code from...
Do you think I should declear myHashFunction inside the private section?
I think those code from you should work
int hashFunc ( char *key ) {
int res = 0;
while ( *key ) res += *key++;
...
Thanks for helping.
it's quiet good.!
Would you pls explain (what source.begin() + 2, destination.begin() + 3) for?
Do you know any STL Lists method that i can copy the cards to object B?
i am looking the MSDN guide, but still no idea..
Because i am writing a soliatire game
The Deck class is those cards which the player click the upper-left corner.
The Pile class is those card the user can place it from the Deck class.
I see, this should be the format of copying the elements from object A to object B.
Do I need to include some specific header?
Suppose I have two classes - Deck and Pile and I created 2 obects inside the Pile class
Deck MyDeck; // Instantiate a Deck object.
Pile MyPile; // Instantiate a Pile...