O'Reilly logo

From Java to C#: A Developer's Guide by Heng Ngee Mok

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 26. C# structures

Structs (structures) in the C language were used very commonly long before OO programming became popular. [1] They are used to group together multiple primitive data types to create a new data type (or data structure). Today, OO classes have taken over much of the functionality of structs, but they are still relevant in C# because careful use of structs can improve the performance of a program significantly. [2]

[1] Structs in C# are slightly different from structs in C++ (and significantly different from the original structs in C). So even if you are familiar with C/C++, it is not recommended to skip this chapter.

[2] I have to note too, that poor use of structs can also decrease performance. For this reason, I think ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required