c# - What does it mean when a struct has no identity? -


I read many threads about structs (about a temporary structs) and I keep reading That's how struct should not be recognized.

What is the lack of identity in a structure actually? I think it will be like a number, e.g. 5, there is no reference (5?) Where the customer is expecting a service, and thus there is an identity, am I thinking correctly?

I know technical differences and how structs thread is secure (unless they can not be mutated, but I can still write methods to change the state), they have every new copies They are passed in a method, etc. ...

This means that you have only one The only data is the Struct value stores - there is no difference between a "5" and the other "5", compare it to one category:

  and To someone who 1 = new Person ( "John"); Person 2 = new person ("John"); Person person 3 = person 2;  

is now a reference to specific objects near person1 and person2 , although they both include the same data person2 See the identical object both and person3 This distinction does not exist with Structs.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -