How to use the structure of C #
Editor to share with you how to use the structure of C#, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!
The structural user program of C#:
Public struct content {string title; string author; string contentcontent; string url;}
However, it is found that after instantiating content:
Content ok=new content ()
Unable to get title and so on through ok
Then I suddenly remembered that I need to set the internal element title and so on to public, otherwise C# will default to private, so change the code to:
The structural user program of C#:
Public struct content {public string title; public string author; public string contentcontent; public string url;}
The structure of C # is used to solve the problem.
The above is all the contents of the article "how to use the structure of C#". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!