The extern keyword in C and C++ extends the visibility of variables and functions across multiple source files. In the case of functions, the extern clause is used implicitly. But with variables, you have to use the keyword explicitly. I believe a simple code example can explain things better in some cases than a wall of text.

4m read timeFrom freecodecamp.org
Post cover image
Table of contents
extern with Functionsextern with VariablesConclusion

Sort: