Back to course

Variables and Assignment

C++ Masterclass: From Zero to Hero

Variables are containers for storing data. cpp int age = 25;

Rules for naming variables:

  • Must start with a letter or underscore.
  • Cannot contain spaces or special characters.
  • Cannot be a keyword (like int).