Why whole structure can not be compared in C yet it can be copied? In other words, Why comparison in below program does not work? It does not print string.
#
But if you pass your value to a string, will it work?
void Comparethisvalue(emp a, emp b)
{
if(a.n.tostring()+a.age.tostring() == b.n.tostring()+b.age.tostring())
return true;
}
in code you can call
if(Comparethisvalue(e1, e2))
{
//do something
}
Or you can implicit do it:
void Comparethisvalue(emp a, emp b)
{
if(a.n == b.n && a.age == b.age)
return true;
}