External and Static Linkage
`extern` declares something defined in another file; `static` hides a file-level name from other files.
Easy
/* config.c */ int baud = 115200;
/* main.c */ extern int baud;
Make helper functions static so they don't clash across modules.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.