In the previous chapter, we saw how variables are written and touched on the high-level functionality that they provide. However, we're still missing the syntax that makes all of that possible. Variables don't just appear at the top of a C# script; they have to be declared according to certain rules and requirements. At its most basic level, a variable statement needs to satisfy the following requirements:
- The type of data the variable will store needs to be specified.
- The variable has to have a unique name.
- If there is an assigned value, it must match the specified type.
- The variable declaration needs to end with a semicolon.
The result of adhering to these rules is the following syntax:
dataType uniqueName = value;
Variables need unique names to avoid conflicts with words that have already been taken by C#, which are called keywords. You can find the full list of protected keywords at https://docs.microsoft.com/en-us/dotnet/csharp/language...