Variables
Creating a variable reserves a memory location, or a space in memory, for storing values.
To use a variable, it must first be declared by specifying the name and data type.
A variable name, also called an identifier, can contain letters, numbers and the underscore character (_) and must start with a letter or underscore.
For example, firstName and lastName are good descriptive variable names.
Double vs Float
As the name implies,double has 2x the precision of float. In general a double has 15 decimal digits of precision, while float has 7.
IDE
To create a C# program, you need to install an integrated development environment (IDE) with coding and debugging tools. For example: Visual Studio Community Edition.
Assignment Operators (=) / Postfix & Prefix Operators
The = assignment operator assigns the value on the right side of the operator to the variable on the left side.
int x = 42;
-
Postfix example:
int x = 3;
int y = x++;
// x is 4, y is 3
The prefix example increments the value of x, and then assigns it to y.
The postfix example assigns the value of x to y, and then increments x.
The postfix example assigns the value of x to y, and then increments x.