G
Gregory Pietsch
Richard said:Okay, than I should be more spesific.
I've got this:
typdef struct
{
int x;
int y;
} Point;
// I now want to make a function that checks if a Point is empty
int pointEmpty(Point p)
{
return (p /*isEmpty*/ ? 1 : 0)
}
How should I do that?
TIA
One way: add a value to the structure:
typedef struct {
int x, y, is_empty;
} Point;
then the implementation of the function is easy:
int pointEmpty(Point p)
{
return (p.is_empty != 0);
}
Just remember to initialize the value somehow.
Gregory Pietsch