Connecting Tech Pros Worldwide Help | Site Map

Comparing 2 structs

 
LinkBack Thread Tools Search this Thread
  #1  
Old September 6th, 2006, 12:05 AM
Jing Yong
Guest
 
Posts: n/a
Default Comparing 2 structs

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)


  #2  
Old September 6th, 2006, 03:45 PM
Davlet Panech
Guest
 
Posts: n/a
Default 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.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.