I've been given an assignment to make 3 template classes for stacks. The 1st is for a static stack. The 2nd for dynamic stacks. The 3rd is for linked lists. The code for the first one is below. I...
Type: Posts; User: AdioKIP
I've been given an assignment to make 3 template classes for stacks. The 1st is for a static stack. The 2nd for dynamic stacks. The 3rd is for linked lists. The code for the first one is below. I...
Got a small program. To Run, here is the code.
#include <iostream>
#include <conio.h>
#include <string>
#include <stdio.h>
#include <stack>
using namespace std;
Thats what I thought I woudl have to do somehow but am unclear on how to do it. Can you explain more on the function you mentioned ( strtok(). ) I have never heard of it. I had considered doing my...
Still working with stacks and have gotten use to working with them but i have encountered another problem. I have to input an expression as a string and push the numbers in it on the stack (example:...
Thanks for the info, that helped my basic understanding. When you say MSVC++ doesn't fully support them what do you mean? Am I better off using the borland compiler when working with Template Classes?
Once again were back to working on Template classes which I do not understand at all. I have to make a stack by using a dynamic array. This is to be done with a Template Class. Can someone please...
I had just figured that out before you posted Sorensen. Those were my only errors, the program now works great. Thanks for all the help to everybody who replied. I really appreciate it.
Heres my new code. It compiles and runs but something is going wrong in my function. Not sure what though. The program just stops at some point and nothing happens. The whole point of the program is...
I still can't figure out why my program won't compile past this line. What am I doing wrong here
void switch_stack(stack); //Function to move items from 1 stack to the other.
Alright thanks for the advice, I will implement some of the changes you mentioned and see what happens. One thign I did forget to mention was that the first stack must remain unchanged. Thats why I...
Thanks, after making the post last night I came across a post that answered the name space question. I still need some help with this program though. Anymore help is appreciated...
Hello, I'm having trouble with stacks. For some reason I can't use them unless I use the line
using namespace std;
Is this normal or is this something I am doing wrong. I am also trying to read...
Here is a sample of my code which I know you will probably laugh at but the people who taught me C++ were jackasses and never taught me how to use template classes or anything else I need to know...
Ok, I input a string of characters from the keyboard. I need to know how to read that string into a stack. Everytime I do it seems to be reading the whole string in as one character. HOw can I get it...
Thanks for some response, I did overload the operators. I figured out most of the problem and will post some of the code later on today if I have time.
Alright, I have an assignment in C++. I need to create a template class for imaginary expressions of the form a+bi and consider the following:
Default Constructor
Copy Constructor
Destructor ...