In an exercise, I need to create a function that returns TRUE if the points are identical. For the points, a structure was implemented as follows:
typedef struct //Estrutura definida para os pontos.
{
double x; //Coordenadas X e Y.
double y;
} Ponto;
The function I created was as follows:
int pontoCoincide(Ponto P, Ponto Q)
{
int coincide = 0;
if(P.x == Q.x && P.y == Q.y)
coincide = 1;
return coincide;
}
I wonder if what I've done is right and that's just it, or if there's something wrong. Remember that I need to create the function with exactly those parameters.