Understanding Data Types

In any programming language, the compiler, the part of the Visual Studio .NET Framework that interprets the code you write into a language the computer can understand, must fully understand the type of data you're manipulating in code. For example, if you asked the compiler to add the following values, it would get confused:

659 / "Dog"

When the compiler gets confused, it either refuses to compile the code (which is the preferred situation because you can address the problem before your users run the application), or it halts execution and displays an exception (error) when it reaches the confusing line of code. (These two types of errors are discussed in detail in Hour 15, “Debugging Your Code.”) Obviously, you can't ...

Get Sams Teach Yourself Microsoft® Visual C#™ .NET in 24 Hours now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.