Home > Articles

  • Print
  • + Share This
This chapter is from the book

Summary

In this lesson you learned about using memory to store values temporarily in variables and constants. You learned that variables have a size determined by their type and that the operator sizeof can be used to determine the size of one. You got to know of different types of variables such as bool, int, and so on and that they are to be used to contain different types of data. The right choice of a variable type is important in effective programming, and the choice of a variable that’s too small for the purpose can result in a wrapping error or an overflow situation. You learned about the keyword auto, where you let the compiler decide the data-type for you on the basis of the initialization value of the variable.

You also learned about the different types of constants and usage of the most important ones among them using the keywords const, constexpr, and enum.

  • + Share This
  • 🔖 Save To Your Account