|
Okay, now my compiler just thinks it's funny. | by Llyr | 2002-09-29 13:54:40 |
|
Nah, it thinks you're funny. | by Arcanum | 2002-09-29 14:00:45 |
|
And, hey, it could be worse. | by Arcanum | 2006-11-19 12:55:59 |
|
Maybe you can figure out what's wrong here. (n/t) | by Llyr | 2002-09-29 14:09:00 |
|
My header file: | by Llyr | 2002-09-29 14:09:36 |
|
And my function definitions. | by Llyr | 2002-09-29 14:10:24 |
|
Slap those two in a project | by Llyr | 2002-09-29 14:11:08 |
| Well, for starters... |
by Arcanum |
2002-09-29 14:31:09 |
| Your overloaded operator functions are returning references to objects that will no longer exist once the function exits. This is a Bad Thing. You'll need to create new dynamically allocated objects using 'new', which in turn introduces memory management issues. Isn't C++ fun? :)
You also really should use a different variable name, if only for clairity's sake, since you already have an "r" defined elsewhere. |
|
[ Reply ] |
|
Where do I have "r" defined elsewhere? | by Llyr | 2002-09-29 14:37:11 |
|
In your header file. | by Arcanum | 2002-09-29 14:42:09 |
|
That's the ONLY r I have! | by Llyr | 2002-09-29 14:45:02 |
|
No... | by Arcanum | 2002-09-29 14:52:59 |
|
oh. (n/t) | by Llyr | 2002-09-29 15:18:57 |
|
Okay, revised def. code. | by Llyr | 2002-09-29 15:23:55 |
|
Aren't you getting a whole bunch of | by Arcanum | 2002-09-29 15:43:10 |
|
Aaahhhh. There we go. (n/t) | by Llyr | 2002-09-29 16:02:07 |
|
First rule of debugging compile-time errors: | by Arcanum | 2002-09-29 16:06:04 |
|
heh. (n/t) | by Llyr | 2002-09-29 16:08:51 |
|
Oh, about the cout statement in your midpoint fcn. | by Arcanum | 2002-09-29 15:26:38 |
|
That's why I overloaded the << operator. (n/t) | by Llyr | 2002-09-29 16:09:14 |
|
But you haven't written a function | by Arcanum | 2002-09-29 16:16:27 |
|
Required. | by Llyr | 2002-09-29 16:19:06 |
|
Ahh, ok... | by Arcanum | 2002-09-29 16:30:14 |
|
It actually shouldn't be bad. (n/t) | by Llyr | 2002-09-29 16:33:38 |
|
Let me know how you do it. (n/t) | by Arcanum | 2002-09-29 16:36:12 |
|
I just need to know... | by Llyr | 2002-09-29 16:40:17 |