Code 1:
struct demo
{
int a;
}d[2];
int main()
{
d[0].a=5;
d[1]=d[0];
return 0;
}
This code works fine
Code 2:
struct demo
{
int a;
}d[2];
int main()
{
d[0].a=5;
d[1]=d[0];
if(d[0]==d[1])
{
printf("hello");
}
return 0;
}
This code gives error
error: invalid operands to binary == (have 'struct demo' and 'struct demo')
Why this error is coming in Code 2 ?