On this page
  1. extern
  2. Availability
  3. Syntax & Overview
  4. Notes & Pitfalls
  5. Example

extern

Prev: static | Up: builtins | Next: inline
Rel: static, Build Pipeline & Linking
Ref: cppreference — extern
Tags: #public #prog #c #builtins #tier/standard


Availability

Built-in (Storage-Class Specifier) — requires no #include header.

Syntax & Overview

extern T symbol;

Declares a variable or function with external linkage defined in another translation unit without allocating storage.

Notes & Pitfalls

Example

// In header.h:  extern int g_retries;
// In config.c:  int g_retries = 3;

Linked from

Related notes