In C++, variables must be declared before they are used. This is because the compiler needs to know the type of the variable in order to allocate the correct amount of memory for it. Failure to declare a variable before using it will result in a compilation error.