Author
|
Topic: Fuck you, compiler.
|
cfalcon
OLDNBLD
Member # 19
Member Rated:
|
posted 08-10-2003 12:46 PM
God damn piece of shit compiler.
Ok, can someone tell me how, in C++, to create the following classes?
class A { B *bpoint; int payload; };
class B { A *apoint; char payload; };
This means I want "A" to consist of a pointer to B and an integer, and "B" to consist of a pointer to A and a character.
What happns when I do this is it complains because it doesn't know what a "B" is when it gets to the part about a B pointer- because class B hasn't been declared yet.
But obviously switching them won't solve it.
Sucksucksucksucksucksucksucksucksucksucksucks!
Am I missing something obvious? If you are in school of CS or something, and know the answer to this trivial problem, pls post it.
Unless you are 10k, because then you aren't reading this.
From: 39°45' N, 104°52' W | Registered: Feb 2000
| IP: Logged
|
|
cfalcon
OLDNBLD
Member # 19
Member Rated:
|
posted 08-10-2003 12:47 PM
If the answer involves
template <class T>
I will cry a little.
From: 39°45' N, 104°52' W | Registered: Feb 2000
| IP: Logged
|
|
The Muffin King
Farting Nudist
Member # 2240
Member Rated:
|
posted 08-10-2003 01:53 PM
The answer involves template <class T>
From: Maryland | Registered: Sep 2001
| IP: Logged
|
|
Fluorine
SMELLY BUTT
Member # 2904
Member Rated:
|
posted 08-10-2003 02:24 PM
Try that:
class B;
class A { B *bpoint; int payload; };
class B { A *apoint; char payload; };
Registered: Jun 2002
| IP: Logged
|
|
Rysto
Farting Nudist
Member # 24
Member Rated:
|
posted 08-10-2003 02:31 PM
You're not going to like this, but at least it won't make you cry a little:
code:
class B;
class A { B *bpoint; int payload; };
class B { A *apoint; char payload; };
- - - - - So "a" can be any value? -a guy in my Calculus class, on the nature of variables
From: Waterloo, Ontario, Canada | Registered: Feb 2000
| IP: Logged
|
|
cfalcon
OLDNBLD
Member # 19
Member Rated:
|
posted 08-10-2003 02:34 PM
Yea, that worked.
K mentioned something about declaring them in a bigger thing, maybe he meant above.
Either way, thanks. I guess the first thing just declaring existence is pretty concise, after all.
From: 39°45' N, 104°52' W | Registered: Feb 2000
| IP: Logged
|
|
AnnieKat
Suicidal Failure
Member # 3202
Member Rated:
|
posted 08-10-2003 02:43 PM
CS class used to put me in shock. I'd compile the program, and it'd say 5 or 6 errors. I'd be like... YAY! But no, it was too soon. I'd fix one error, and 10 more would appear in its place... I once had 10093 errors in a 300 line program.
It was then that I decided to stay far away from the school of computer science, and do something that doesn't basically require any skills or (for that matter) common sense.
I'm now studying to become a psychiatrist.
- - - - - aתּņĩềκẢ†~ nθW |’m @ r33| ķıťŧŷ
Anthrax, will you marry me?
From: Anthrax's Love Nest | Registered: Jan 2003
| IP: Logged
|
|
Slade_64
chipmunk pr0n author
Member # 804
Member Rated:
|
posted 08-10-2003 11:08 PM
quote: Originally posted by AnnieKat: ...I'm now studying to become a psychiatrist.
He. He he. Ha ha ha. HAAAAAHAAAAAAAAHAAAAAAAAAAAA... LOL... ROTFLMFAO!!!!!!!!eleven!!!!! Ha, ha mmm...........
Ah, I needed that...
- - - - - Bucket.
From: Funky Town Texas | Registered: Aug 2000
| IP: Logged
|
|
Twinkle
I'm feeling fat and sassy~!
Member # 1690
Member Rated:
|
posted 08-11-2003 02:46 AM
ITT you recommend a shrink?
- - - - - Hich loch faauto noxlattoyen.
From: Brinstar | Registered: Apr 2001
| IP: Logged
|
|
AnnieKat
Suicidal Failure
Member # 3202
Member Rated:
|
posted 08-11-2003 10:14 AM
What's sad is that most of the psychology students I've met aren't any saner than I am...
- - - - - aתּņĩềκẢ†~ nθW |’m @ r33| ķıťŧŷ
Anthrax, will you marry me?
From: Anthrax's Love Nest | Registered: Jan 2003
| IP: Logged
|
|
Donald
Bob the Builder
Member # 1551
Member Rated:
|
posted 08-11-2003 10:48 AM
I am suffering from code rage
*hurls his PC out a window*
From: In your girl's panties | Registered: Feb 2001
| IP: Logged
|
|
dAyWaLkEr
Farting Nudist
Member # 3343
Member Rated:
|
posted 08-11-2003 11:51 AM
meh, at least your high schools don't use some shitty language like OOT (sorta like Pascal). i think the canadian government thought us kids were too stupid to grasp C++ or Java and gave us this "approved for school" piece of crap that has missing syntax's in its tutorial and lags when you do realtime events
gogogo canada
- - - - - absence of evidence isn't evidence of absence
Registered: Apr 2003
| IP: Logged
|
|
Fenix
I live in a public bathroom.
Member # 2371
Member Rated:
|
posted 08-11-2003 03:43 PM
Our school still teaches Pascal, which I hated. We just got a Java class for this year's curriculum, which required all of our computer labs getting new computers since our 200mhz Gateways ( ) froze up when they tested the compiler on them.
- - - - - life of lively to live to life of full life thx to shield battery
From: The Homeworld, Aiur | Registered: Nov 2001
| IP: Logged
|
|
Charmeleon42
Date Rapist
Member # 1066
Member Rated:
|
posted 08-11-2003 06:10 PM
While we're on the subject of programming...
I downloaded Visual Studio 6.0 off Kazaa at Ikuse's house, and was trying to learn how to do stuff with it... more stuff anyway, since I took Intro to C++ my sophomore year.
I found something about a PutPixel() thing, to use which I needed graphics.h. I tried sticking it in there, but it didnt have graphics.h or something... so was the download a bork, is graphics.h some obscure file, or does it come in some version after 6.0? :/
From: Mountain Dew Land | Registered: Oct 2000
| IP: Logged
|
|
Fluorine
SMELLY BUTT
Member # 2904
Member Rated:
|
posted 08-11-2003 06:23 PM
#include <graphics.h>
Registered: Jun 2002
| IP: Logged
|
|
Charmeleon42
Date Rapist
Member # 1066
Member Rated:
|
posted 08-11-2003 11:21 PM
Quoting from myself: I tried sticking it in there,
I obviously tried that.
From: Mountain Dew Land | Registered: Oct 2000
| IP: Logged
|
|
dAyWaLkEr
Farting Nudist
Member # 3343
Member Rated:
|
posted 08-11-2003 11:37 PM
turing is crap, practically anything over 1000 lines can cause unexplained errors and crashes
it even failed to load countless times my friend's YGO dating sim
and just to let you know, the comp's are 500 mhz machines
- - - - - absence of evidence isn't evidence of absence
Registered: Apr 2003
| IP: Logged
|
|
Rolken
Vulcan
Member # 7
Member Rated:
|
posted 08-11-2003 11:39 PM
quote: Originally posted by AnnieKat: What's sad is that most of the psychology students I've met aren't any saner than I am...
Takes one to know one.
From: Provo, UT | Registered: Feb 2000
| IP: Logged
|
|