ziamughal, if you are trying to figure out how generics work in C++, try modifying your stack implementation to be generic.
If you just need a stack, go with the one from standard template library, like weaknessforcats says.
http://www.cplusplus.com/reference/stl/stack/...
User Profile
Collapse
-
Yes, but i think the guy wants to roll his own - for educational purposes or somethingLeave a comment:
-
If you want the client part to just pass a command, in a sort of "fire and forget" mode, you just need to implement a queue of some sort.
You can do it simple by adding a file to a folder, and having the server scan.
You can do it using a socket connection.
You can do it using a HTTP request.
You can do it using a Database, and a "server" in the database as a stored procedure, or a server polling the database....Leave a comment:
-
I would always go for the union,
If the user selects something and tries to delete, there should be no reason to leave out deleting some.. They are selected, and therefore deleted, right??Leave a comment:
-
You should start along the line of..
template <class T>
class stack
{
public:
stack();
void push(const T&);
void pop();
void display();
const T& topelement();
bool isEmpty();
void makeEmpty();
private:
struct Node
{
T data;
Node* preptr;
};
Node* current,*head,* top;
...Leave a comment:
No activity results to display
Show More
Leave a comment: