473,386 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Why real OBJECT compared to NULL returns TRUE?

Sly
Hi!
I am facing an unbreakable wall.
I have a class 'x' with one array in it called arr;

in Equals(x arg) routine I compare the elements of the
array.
But first I check whether
if( arg.arr == null )
{
return( false ) ;
}
DEBUGGER shows 3 elements in the array - so it is not
NULL!
comparison however returns TRUE !!!!!!!

What the heck is this?
Can anyone help me on that please?

Sly

Nov 15 '05 #1
4 2997
can you post the code that deals with arr? Or the code where you're
initializing the array.. or the part where you pass your array to the
Equals() method.

-Andre

Sly wrote:
Hi!
I am facing an unbreakable wall.
I have a class 'x' with one array in it called arr;

in Equals(x arg) routine I compare the elements of the
array.
But first I check whether
if( arg.arr == null )
{
return( false ) ;
}
DEBUGGER shows 3 elements in the array - so it is not
NULL!
comparison however returns TRUE !!!!!!!

What the heck is this?
Can anyone help me on that please?

Sly


Nov 15 '05 #2
This might be a dubugger's glitch. Make sure you've installed latest VS SPs.
Val.

"Sly" <sw******@cox.net> wrote in message
news:07****************************@phx.gbl...
Hi!
I am facing an unbreakable wall.
I have a class 'x' with one array in it called arr;

in Equals(x arg) routine I compare the elements of the
array.
But first I check whether
if( arg.arr == null )
{
return( false ) ;
}
DEBUGGER shows 3 elements in the array - so it is not
NULL!
comparison however returns TRUE !!!!!!!

What the heck is this?
Can anyone help me on that please?

Sly

Nov 15 '05 #3
Hi!

IT IS A DEBUGGER GLITCH!
I have downloaded a fix for it (after 1hour search)
Thanks for all reply's

Sly

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #4
G
Was this bug in vs.net 2002 or 2003?
Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bijay Kumar | last post by:
Hi Guys, I was going through the source code of Object.cs in rotor. What I found is Equals() implemented as follows: public extern virtual bool Equals(Object obj); What I don't...
0
by: Bijay Kumar | last post by:
Hi Guys, I was going through the source code of Object class (Object.cs in rotor). What I found is Equals() implemented as follows: public extern virtual bool Equals(Object obj); What...
17
by: Zeng | last post by:
I'm trying to comparing 2 objects (pointer to object) to see if they are the "same" as each other. Here is what the definition of being the "same" object type for both objects, object 1, ...
14
by: MuZZy | last post by:
Hi, Lately i've been (and still am) fixing some memory leaks problems in the project i just took over when i got this new job. Among the other issues i've noticed that for localy created objects...
2
by: Tim | last post by:
Hi, I am trying to do a simple comparison and finding it quite difficult. I call a SQL Server stored procedure which returns a Bit as one of the record fields. All I want to do is see if the...
7
by: Arpan | last post by:
The .NET Framework 2.0 documentation states that An Object variable always holds a pointer to the data, never the data itself. Now w.r.t. the following ASP.NET code snippet, can someone please...
139
by: Joe Mayo | last post by:
I think I become more and more alone... Everybody tells me that C++ is better, because once a project becomes very large, I should be happy that it has been written in C++ and not C. I'm the only...
22
by: Bill Reid | last post by:
I just noticed that my "improved" version of sscanf() doesn't assign floating point numbers properly if the variable assigned to is declared as a "float" rather than a "double". (This never...
16
by: DamienS | last post by:
In the interests of me saving hair, can someone please explain to me what's going on below? Why doesn't == work in comparing two int's when cast as objects? They're the same type. Note that it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.