In C++, the declaration and definition of a variable are two distinct concepts:
Declaration: A variable declaration introduces the existence of a variable to the compiler. It tells the compiler about the variable's name and data type but does not allocate memory for the variable. A variable can be declared multiple times in different parts of the program, but it should be defined exactly once. The declaration is usually done in header files or using the "extern" keyword.
extern int age; // Variable declaration
Definition: A variable definition, on the other hand, not only declares the variable but also allocates memory for it. It associates the variable name with a specific memory location where the data will be stored. A variable must be defined exactly once in a program (unless it's declared as "extern" and defined in another translation unit).
int age = 30; // Variable definition