About 5,410,000 results
Open links in new tab
  1. How to correctly use the extern keyword in C - Stack Overflow

    Jan 31, 2009 · My question is about when a function should be referenced with the extern keyword in C. I am failing to see when this should be used in practice. As I am writing a …

  2. How do I use extern to share variables between source files?

    Using extern is only of relevance when the program you're building consists of multiple source files linked together, where some of the variables defined, for example, in source file file1.c …

  3. What is the effect of extern "C" in C++? - Stack Overflow

    Jun 25, 2009 · extern "C" makes a function-name in C++ have C linkage (compiler does not mangle the name) so that client C code can link to (use) your function using a C compatible …

  4. c - What's the difference between using extern and #including …

    Aug 23, 2011 · The other is using header files: Declare functions/variables using extern in a header file (*.h/*.hh). Still, extern is optional for functions, but not for variables. So you don't …

  5. c++ - How to declare constexpr extern? - Stack Overflow

    May 13, 2015 · Is it possible to declare a variable extern constexpr and define it in another file? I tried it but the compiler gives error: Declaration of constexpr variable 'i' is not a definition in .h: e...

  6. c++ - How does extern work? - Stack Overflow

    Aug 26, 2013 · extern as a storage class specifier tells the compiler that the object being declared is not a new object, but has storage elsewhere, i.e., is defined elsewhere. You can try this …

  7. Effects of the extern keyword on C functions - Stack Overflow

    The extern keyword takes on different forms depending on the environment. If a declaration is available, the extern keyword takes the linkage as that specified earlier in the translation unit.

  8. extern - using value of external variables in assembly - Stack …

    Nov 18, 2019 · I'm having a bit of trouble working with .extern variables in assembly. How can I get their value to put into a register? .extern a, b, c .global main .text main: mov *value of a*, …

  9. extern const in c++ - Stack Overflow

    Mar 12, 2012 · interesting to note the extern declaration must be made in the same translation unit as the variable is defined. in this example you are effectively declaring it extern const first, …

  10. Extern enum between different source files - C - Stack Overflow

    Sep 15, 2017 · Extern enum between different source files - C Asked 8 years, 1 month ago Modified 3 years, 10 months ago Viewed 32k times