Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
A variable is a named memory location that stores data. Every variable in C++ must be declared with a type before use.
int age;Reserves memory without assigning a valueint age = 25;Declares and assigns in one stepint a = 1, b = 2, c = 3;Multiple variables of the same typeconst int MAX = 100;Value cannot be changed after initializationint _count = 0;int class = 5;int Age ≠ int ageint my var = 1;Uninitialized local variables contain garbage values. Always initialize your variables to avoid undefined behavior in your programs.