Skip to content

Glossary: C++ Basics

Global variable

Also written: globals

A variable declared outside every function, so any code in the program can read and change it. Because that makes it hard to tell what changed a value, globals tend to hide bugs and are best avoided.

Where the book teaches it

Related terms

Local variableScope