Chapter 3. Variables and Operators

After completing this chapter, you will be able to:

  • Declare (create) variables.

  • Use the built-in C++ data types.

  • Use the Microsoft .NET Framework String class.

  • Assign values to a variable.

  • Create expressions by using the C++ operators.

  • Cast (change) the type of a variable.

In Chapter 2, you looked at the advantages of object-oriented programming and developed a simple application to illustrate the creation and use of classes.

In this chapter, you’ll take a closer look at how to create and use variables, the fundamental data types of C++, how to access and use classes from the .NET Framework, and how to create expressions by using C++ operators.

What is a variable?

Variables are locations in memory where data can be temporarily ...

Get Microsoft Visual C++/CLI Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.