Connecting Tech Pros Worldwide Help | Site Map

Comparing 2 structs

Jing Yong
Guest
 
Posts: n/a
#1: Sep 6 '06
I have a classtruct of over 50 members


class A {
public:
type -- 50 members
A(){initialize all members}
friend operator==(A&,A&){//my operator goes here
}
}B[2];

In the operator I have to compare each member of A , and this looks not
good
Any other ways for the comparison of B[0] and B[1] please?

Also, in that case how are the values evaluated by the VC6 compiler (I
am using)?
Regards,
Yong jin (~.~E)

Davlet Panech
Guest
 
Posts: n/a
#2: Sep 6 '06

re: Comparing 2 structs


Jing Yong wrote:
Quote:
I have a classtruct of over 50 members
>
>
class A {
public:
type -- 50 members
A(){initialize all members}
friend operator==(A&,A&){//my operator goes here
friend bool operator (const A &, const A &) { ... }
Quote:
}
}B[2];
>
In the operator I have to compare each member of A , and this looks not
good
Any other ways for the comparison of B[0] and B[1] please?
No there's no other way.
Quote:
>
Also, in that case how are the values evaluated by the VC6 compiler (I
am using)?
What values? What do you mean by "evaluated"? You mean in the comparison
operator? They are "evaluated" in the order you evaluate them. It's not
clear what you are asking, give us an example.

D.
Closed Thread