C++ TutorialLesson 7Free preview
C++ Variables
This lesson is part of C++ · All levels
Summary
This lesson discusses variables as the data naming containers in memory. You learn how to declare variables with the right kind of data, give them a starting value, and change them back as the program runs. The rules of proper naming are also discussed so that the code is free of syntax errors.
Key points
- The variable must be declared with the data type before use.
- Name rule: under-scoring, no spaces, and no keywords.
- The value of the variable can be changed during the program's run.
- Examples of basic data types: int, float, char, string, bool.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.