473,666 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3009
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.n et> 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
3221
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 understand is:
0
4627
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 I don't understand is:
17
7446
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, object 2, same? ----------------------------------------------------------- Decimal 199677 199677 yes String "hello" "hello" yes null null yes
14
3144
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 it makes difference to explicitly put them to null after working with them is done - it somehow makes the GC collect them sooner, like here: void SomeFunc() { MyClass c = new MyClass();
2
1340
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 Bit being read is a 1. I have tried this: if(dbDataReader->get_Item("On") == 1) but this does not work since get_Item returns an Object*.
7
2851
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 explain me what does the above statement mean? <script runat="server"> Class Clock
139
5912
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 guy thinking that C is a great programming language and that there is no need to program things object oriented. Many people says also that they save more time by programming projects object oriented, but I think its faster to program them in a...
22
2761
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 cropped up before, since I rarely use "float"s for anything, and hardly ever use the function for floating-point numbers in the first place; I just was messing around testing it for all cases and noticed a problem.) Anyway, it is declared and I...
16
1657
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 worked for strings. Thanks in advance, Damien
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8551
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7386
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4368
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1775
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.