C # equality comparison,
This article describes C #Equality comparison, Which focuses on the following two aspects:
= And! = Operator, when can they be used for Equality comparison, and when they are not applicable. If they are not used, what is
. Net equality comparison,. net equalityReference equality and Value Equality in C #, equality is dividedReference equalityAndEquality of Values. Equality of reference refers to the equality of reference if two variables of the reference type
referential equality and value equalityin C #, equality is divided into reference equality and value equality . Reference equality refers to reference equality if a variable of two reference types refers to the same object. //x, Y, Z are all
The CLR provides the ability to differentiate between types of equality and identity.
L Equality: If two objects are of the same type, and they each have the same and equivalent attributes. (They are instances of the same type and if each of the
The CLR provides the ability to differentiate between types of equality and identity.
L Equality: If two objects are of the same type, and they each have the same and equivalent attributes. (They are instances of the same type and if each of the
The following is a detailed summary of the description and function of various operational symbols in C #first, []square brackets ([]) are used for arrays, indexers, and properties, and also for pointers.1, the array type is a type followed by
C # Operators
An operator is a symbol that tells the compiler to perform a specific mathematical or logical operation. C # has a rich set of built-in operators, categorized as follows:
Arithmetic operators
Relational operators
logical
Delete delete operatorfrees the memory block.Grammar
[::] Delete cast-expression
[::] Delete [] cast-expression
NoteThe cast-expression parameter must be a pointer to a memory block that was previously assigned to an object created
STL is full of comparing whether objects have the same value. For example, if you use find to locate the location of the first object with a specific value in the interval, find must be able to compare two objects to see if one value is equal to
Compare equality of objectsMechanisms that need to understand the equality of objects are important for programming logical expressions , and also important for implementing operator overloading and type casting . The mechanism for object
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.