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 20:20

>>18
Oh god, it actually worked. To be honest with you, your code itself didn't help, but the &box thing (somehow) managed to do the trick. I still don't know what the heck it's doing, but my code is actually working now:

bool collision(Box &a, Box &a){}

I could kiss you right now. I guess I should learn more about addresses and pointers before advancing any further. Some how I've managed to survive up to this point with little or no help from my peers. High-school, college, and universities are useless, hence the reason why I taught myself Algebra, calculus, and some C languages. But C++ is finally starting to get to me. Everyday there's a new bug to fix or some minor limitation to overcome. To put this in layman's terms, C++ has taken a giant shit in my pipe-dream. Now the pipes to my dreams are clogged. I feel so lonely in my battles against C++. If this fails, what else could I do with my life?

There should be some type of 'free' Internet tutor guys that go around helping people. Because our current system isn't working. As of right now there's really only two options for becoming a competent programmer:
1). Go to some shitty university and read from text books.
2). Waste months out of your precious (early) 20s becoming a neck-beard while everybody else your age is outside having fun during these crucial years of our development. 

/life story

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