Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi. I have question about the auto-implemented properties in C#. So, when I make an auto-implemented public property in my class but when i make an object (instance) of the class and I set something to the property and then get it how its working when there is no private field ? I think the compiler allocates memory somewhere in the memory and making the property to point to the address of the value ? Is that the answer or I am wrong ?

What I have tried:

Tried to search but with no results. Then I came here to ask my question
Posted
Updated 5-Jun-17 2:09am

1 solution

You still look for someone ot write you a book about programming?

the compiler creates a private, anonymous backing field that can only be accessed through the property's get and set accessors.
 
Share this answer
 
Comments
The_Unknown_Member 5-Jun-17 14:19pm    
Thanks!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900