[Cs3] extern

Mikhail Nesterenko mikhail at cs.kent.edu
Fri Sep 8 12:15:47 EDT 2017


CS3 students,

So there was a discussion on "extern", a lecture ago. A
constant/variable can be declared (as opposed to defined). In which
case its declaration is preceded with keyword extern:

     extern int i;
     extern const int j;

What this means is that this (global) constant or variable is defined
in a different file. Hence, it will be located at linking
stage. Extern-s are often put in header files.

Thanks,
-- 
Mikhail


More information about the cs3 mailing list