Fundamental Elements
A C# program is best understood in terms of three basic elements:
- Functions
Perform an action by executing a series of statements. For example, you may have a function that returns the distance between two points or a function that calculates the average of an array of values. A function is a way of manipulating data.
- Data
Values that functions operate on. For example, you may have data holding the coordinates of a point or data holding an array of values. Data always has a particular type.
- Types
A set of data members and function members. The function members are used to manipulate the data members. The most common types are classes and structs, which provide a template for creating data. Data is always an instance of a type.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access