Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Help wanted. C++ question.

Name: Anonymous 2009-07-13 17:49

How do I declare a global object 'within' the class's brackets?

class Box{

public:
int x, y;
//Here's the problem.
Box A;//?

bool collision(Box A, Box B){}

}A, B;

Is it even possible to declare global objects within a class? Yes/no? Depending on your answer I may:
 
a) Drop out of college and become a plumber.
b) Kill myself.
c) Finish the app I'm currently working on.

Name: Anonymous 2009-07-13 19:32

>>14
Sadly, I'm a complete rookie at reading other peoples' code (even when it's an alteration of my own code).

It's going to take me (at least) 20 minutes to digest this code. I'll let you know if it helped. But hopefully after reading my code you realize the importance of being able to declare global objects within a class.

Personally, I enjoy placing every/any code related to my class within the class itself. It's neater that way.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List