|
-
Nov 4th, 2002, 09:23 PM
#1
Thread Starter
Addicted Member
equals
Hi,
In an old version of c i had to use something like this: if (x==y). I am wondering if I can now use if (x=y) or do I still need the ==?
Jeremy
-
Nov 4th, 2002, 09:42 PM
#2
PowerPoster
Nope, == is an overloaded operator that implicity performs either a reference equality or value equality comparison, dependent upon the type being used.
-
Nov 5th, 2002, 04:05 AM
#3
Frenzied Member
Also since C# is strongly type, if (x=y) this would never compile, because you are performing and assignment and it would always be true. In C or C++ this would be hard to catch, leading to some frustrating debugging sessions.
Dont gain the world and lose your soul
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|