473,411 Members | 1,968 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,411 software developers and data experts.

compare two structs via ==

I wish to compare two structs via == but it does not compile. I can
overload and create my own == but am I missing something that c#
already has implemented?

~titan

May 30 '07
50 20202
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Thu, 07 Jun 2007 13:45:56 -0700, Mark Wilden <mw*****@communitymtm.com>
wrote:
>Without an operator== overload that would explicitly check equality on the
string arrays, the class instances would be "not equal" even though the
members are "equal".
Right - in -that- part of the discussion, I (think I) was referring to the
(mythical) memberwise comparison that C# doesn't provide, but which I
thought it should. Perfectly clear, n'est-ce pas? :)

///ark
Jun 7 '07 #51

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

Similar topics

6
by: Simon Elliott | last post by:
I have ome new code which has to work with some legacy code which does a lot of memset's and memcmp's on structs of PODs. This leads me to want to do stuff like this: struct foo { unsigned...
5
by: ma740988 | last post by:
There's a need for me to move around at specified offsets within memory. As as a result - long story short - unsigned char* is the type of choice. At issue: Consider the case ( test code ) where...
5
by: Steve Edwards | last post by:
Hi, With much help from this forum I've been using stl containers, but always with other common - or stl - types as members. I've now run in to a problem while trying to use some of my own...
12
by: barcaroller | last post by:
Is it legal to compare the contents of two multi-field variables (of the same struct) using "==" and "!="? struct { int a; int b; } x,y; ...
14
by: Jeff S. | last post by:
In a Windows Forms application I plan to have a collection of structs - each of which contains a bunch of properties describing a person (e.g., LastName, FirstName, EmployeeID, HomeAddress,...
8
by: Joe Van Dyk | last post by:
I have a vector of structs. Say I get a new struct that's supposed to replace one of the structs in the vector. I believe I could use replace_if() to do this, but I'm not sure what the syntax...
61
by: Marty | last post by:
I am new to C# and to structs so this could be easy or just not possible. I have a struct defined called Branch If I use Branch myBranch = new Branch(i); // everything works If I use Branch...
11
by: Cliff Martin | last post by:
Hi, I am reading a fairly large file a line at a time, doing some processing, and filtering out bits of the line. I am storing the interesting information in a struct and then printing it out....
2
by: Zytan | last post by:
I wanted to do something simple like checking my own Color variable against Color.Black, and == returned false, even though their RGB values were all 0! Of course, there's the A (alpha) value, but...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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...
0
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...
0
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...

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.