Hello to you All ,

For some reason , the Compiler throws me an Error
"Illegal Operation" on the Comparison described below :

#include <stdio.h>
#include <math.h>
#include <conio.h>

typedef struct {
double x,y;
} Point;

typedef struct {
Point l, r;
} Rectangle;

typedef struct {
Point Center;
double r;
} Circle;


int main()
{
Circle user_c;
Rectangle user_r;
Point user_p;

printf("Please Enter Upper Right Corner , Lower Left Corner , Point X and Y\n");
scanf("%ld%ld%ld%ld",&user_r.r,&user_r.l,&user_p.x,&user_p.y);
if ( ((user_p.x) > (user_r.r)) && ( (user_p.x) < (user_r.l)) )
printf("OK");

return 0;
}

user_r.r and user_r.l are Point objects. The < operator isn't defined for them. You need to change your comparison to use user_r.r.x and user_r.r.y and likewise for user_r.l.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.