I'm not very familiar with C++ programming. I know the basics of programming in it (syntax, pointers, etc.) and I've built a few basic programs with it and done some basic debugging at work. I am puzzled by this line of code from Box2D, specifically the Box2dTest project from Cocos2D:
// Define the ground body.
b2BodyDef groundBodyDef;
groundBodyDef.position.Set(0, 0); // bottom-left corner
How is it that one can do this without having initialized groundBodyDef
? I know this isn't an Objective-C thing because the C++ examples for Box2D itself are just like this.