Code:
struct OBJECT{
int x,y;
}myobject;
The above code creates an instance of OBJECT with the name of myobject. To create another instance of object you would need:
Code:
struct OBJECT myOtherObject;
To access a member variable of the structure you need to state which variable you're interested ie myOtherObject, myobject, and access the variable using the dot (.) notation or if you created a pointer use pointer notation (->). Ie. myOtherObject.x myobject.y.
Code:
typedef struct OBJECT{
int x,y;
}MyNewObjectType;
The typedef creates a new Type, in the case above named MyNewObjectType, it doesn't create an instance of that Type, just names a new type. You can now create a new instance of this type without using the struct keyword.
Code:
struct OBJECT test; // Still valid but you must use the struct keyword to make an instance of this structure.
MyNewObjectType test1; // You don't need the struct keyword in this instance since MyNewObjectType is a Type of variable much like an int, or double.
Jim