Could someone help me with operator overloading and my String class. I'm stuck with the '+' operator, which should "return a new object of type CString that contains the contents of 'this' Cstring...
Type: Posts; User: skanxalot
Could someone help me with operator overloading and my String class. I'm stuck with the '+' operator, which should "return a new object of type CString that contains the contents of 'this' Cstring...
Ah, forget about it. I got it working. Thanks for offering though.
Its my own class, here's how it looks:
class CString
{
friend class CStringIterator;
public:
I'm desperate here, please be gracious. I just don't know what to do with this CStringIterator class function that returns the current word in a string.
Here's main:
void main()
{
int...
here ya go.
I need some more help with this program,
from main...
BST Original;
Original.Insert (X);
Original.Insert (Y);
Should I also have done "*P->Left = NULL"? (notice the *)
Thanks for the help, that fixed it. But I'm not sure what you mean here:
---------------------------------------------------------------------------------
You also have some memory leaks...
...
Thanks for the replies, here's all the code.
I'm working on a BST for the first time and need some big time help. I've gotten some of the functionality written and was wanting to test it so I've got this simple code that Inserts a node into...
Forget it, I just found it. I was using namespace std in .h file, not in .cpp file. Thanks for trying to help.
I didn't think so. The header/impl files compile fine with the exception included but the app file goes to crap. When I take the exception class out, the app compiles fine. What's the deal?
When I add an exception in the header/implementation file, what do I have to change in the application file?
That didn't change anything. I had the null commented out when I compiled.
The null was just a space holder from earlier, don't worry about it.
As far as the errors, here's an ex.:
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streamb.h(90): error C2872:...
I want to have an exception for my stack class that is thrown if new memory cannot be allocated for a push. From my book, I entered the following into my program:
#include <exception>...
Cheers mate! :D
I want to delete all of the nodes on the stack. Here's the header file I use with it:
typedef int StackType;
class Stack
{
public:
Stack();
I don't know what's going on here, but its going to crap everytime. I'm just trying to clear all the memory like a good programmer.
#include "stack.h"
#include <cstddef>
Stack::Stack()
{...
Cheers, mate! :D
OK, you're reply didn't make much sense to me as I think I'm quite a bit behind you. I've just been learning recursion for a week now. This is what I know:
To find the binary of a decimal you do...
I'm stuck. Can somebody help me with the algorithm to convert a decimal integer (0 - 1,000,000,000) to binary recursively? I know I'm going to %2 until it equals 0 or 1, but then what do I do?
Thanks!
I have this function for my address book program but the first getline isn't working, somebody please tell me why!
void ChangeEntry (sturec &book, fstream myfile, int &recordnum)
{
int...
I'm getting a compiler error and was hoping someone could help me out. This is what I'm trying:
char identity[7];
string id = ("id") // from the form, this is a CGI program
identity =...