1. Instead of:
Point ThisPoint = createPoint( 1, 1 );
you do:
Point ThisPoint = { 1, 1 };
// That *should* work. If not:
Point ThisPoint;
ThisPoint.X = 1;
ThisPoint.Y = 1;
// That is far more 'efficent'
2. You can't, that's a class. The closest you can do is:
void MovePoint( Point * pPoint, int MoveX, int MoveY )
{
if( pPoint != NULL )
{
pPoint->X += MoveX;
pPoint->Y += MoveY;
}
}
// Usage
Point ThisPoint = { 1, 1 };
MovePoint( &ThisPoint, 10, 15 );
3. For god's sake, just use classes.
Bookmarks