|
|
 |
| C# 2005 For discussion of Visual C# 2005. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the C# 2005 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

June 26th, 2007, 01:54 PM
|
|
Authorized User
|
|
Join Date: Dec 2005
Location: Lucknow, UP, India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
=== operator in c#
Plese tell me about === operator in c#
Surendra
__________________
Surendra Parashar
Gurgaon,
http://www.geocities.com/surendraparashar
|

June 27th, 2007, 06:40 PM
|
|
Wrox Author
Points: 12,801, Level: 49 |
|
|
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,023
Thanks: 1
Thanked 42 Times in 42 Posts
|
|
Do you mean the
== operator? That is an equality operator which determines if the value on the left is equal to the value on the right.
I have never seen === as on operator and it doesn't exist on the MSDN page either: http://msdn2.microsoft.com/en-us/library/6a71f45d(VS.80).aspx
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
|

June 28th, 2007, 07:48 AM
|
|
Registered User
|
|
Join Date: Jun 2007
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
=== does exist in i.e php if I'm not mistaken..
dont remember what it does tho =/
Enuff enuff!
C# btw.
|

June 28th, 2007, 08:00 AM
|
|
Registered User
|
|
Join Date: Jun 2007
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
$a === $b
Identical TRUE if $a is equal to $b, and they are of the same type.
(introduced in PHP 4)
so there :]
-----------
Enuff enuff!
C# btw.
|

June 28th, 2007, 06:39 PM
|
|
Wrox Author
Points: 12,801, Level: 49 |
|
|
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,023
Thanks: 1
Thanked 42 Times in 42 Posts
|
|
So what is it in C# then, do you have a reference to the MSDN perhaps?
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
|

June 29th, 2007, 02:49 AM
|
|
Registered User
|
|
Join Date: Jun 2007
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I doubt it exists in C# tbh..
http://msdn2.microsoft.com/en-us/library/6a71f45d(vs.71).aspx
didnt find it there atleast
-----------
Enuff enuff!
C# btw.
|

November 6th, 2007, 08:05 AM
|
|
Authorized User
|
|
Join Date: Dec 2005
Location: Lucknow, UP, India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
Okay Fine
Surendra Parashar
Gurgaon, Hariyana
http://www.geocities.com/surendraparashar
|

November 8th, 2007, 04:55 AM
|
|
Authorized User
|
|
Join Date: Sep 2007
Location: , , Finland.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yes, it is there. See is-operator here
http://msdn2.microsoft.com/en-us/library/scekt9xw.aspx
So what you need to do is something like this:
Code:
object obj1 = 1;
object obj2 = "1";
if (obj1 is obj2 and obj1 == obj2)
{
// same as obj1 === obj2
}
else
{
// same as obj1 !== obj2
}
In PHP (and VB without strict option) that would evaluate always as true because of it's sick type casting behaviour.
|

November 8th, 2007, 05:14 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 1,340
Thanks: 0
Thanked 26 Times in 26 Posts
|
|
Another option might be the Object.ReferenceEquals method, depending on what you are trying to achieve.
if( Object.ReferenceEquals(obj1, obj2) )
{
// true if obj1 and obj2 are references to the same object.
}
/- Sam Judson : Wrox Technical Editor -/
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |