p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > C# and C > C# 2005 > C# 2005
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 26th, 2007, 01:54 PM
Authorized User
Points: 104, Level: 2
Points: 104, Level: 2 Points: 104, Level: 2 Points: 104, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: Lucknow, UP, India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to surendraparashar
Default === operator in c#

Plese tell me about === operator in c#

Surendra
__________________
Surendra Parashar
Gurgaon,
http://www.geocities.com/surendraparashar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old June 27th, 2007, 06:40 PM
Wrox Author
Points: 12,801, Level: 49
Points: 12,801, Level: 49 Points: 12,801, Level: 49 Points: 12,801, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,023
Thanks: 1
Thanked 42 Times in 42 Posts
Send a message via AIM to dparsons
Default

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
================================================== =========
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old June 28th, 2007, 07:48 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Enslave
Default

=== does exist in i.e php if I'm not mistaken..

dont remember what it does tho =/

Enuff enuff!

C# btw.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old June 28th, 2007, 08:00 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Enslave
Default

$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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old June 28th, 2007, 06:39 PM
Wrox Author
Points: 12,801, Level: 49
Points: 12,801, Level: 49 Points: 12,801, Level: 49 Points: 12,801, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Akron, Ohio, USA.
Posts: 4,023
Thanks: 1
Thanked 42 Times in 42 Posts
Send a message via AIM to dparsons
Default

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
================================================== =========
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old June 29th, 2007, 02:49 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Enslave
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #7 (permalink)  
Old November 6th, 2007, 08:05 AM
Authorized User
Points: 104, Level: 2
Points: 104, Level: 2 Points: 104, Level: 2 Points: 104, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: Lucknow, UP, India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to surendraparashar
Default

Hi,

Okay Fine

Surendra Parashar
Gurgaon, Hariyana
http://www.geocities.com/surendraparashar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #8 (permalink)  
Old November 8th, 2007, 04:55 AM
Authorized User
 
Join Date: Sep 2007
Location: , , Finland.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #9 (permalink)  
Old November 8th, 2007, 05:14 AM
samjudson's Avatar
Friend of Wrox
Points: 4,336, Level: 27
Points: 4,336, Level: 27 Points: 4,336, Level: 27 Points: 4,336, Level: 27
Activity: 40%
Activity: 40% Activity: 40% Activity: 40%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 1,340
Thanks: 0
Thanked 26 Times in 26 Posts
Default

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 -/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
having problem with Between operator anantdev SQL Language 1 May 26th, 2008 09:14 AM
Invalid operator for data type. Operator equals di Pusstiu SQL Server 2000 2 August 10th, 2007 05:51 AM
how to use like operator thillaiarasu SQL Server 2000 3 April 25th, 2007 09:53 AM
intersect operator kapy_kal XSLT 1 March 29th, 2006 02:02 PM
Use of return operator. PC BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 3 July 1st, 2005 10:54 AM



All times are GMT -4. The time now is 11:05 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc