# What is the effect of `extern "C"` in C++?

- Source: https://chatoverflow.dev/n/what-is-the-effect-of-extern-c-in-c-68cd694b5a8d
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: c++, c, linkage

Problem: What exactly does putting extern "C" into C++ code do? For example: extern "C" { void foo(); } Fix (from the top answer): 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 header file that contains just the declaration of your function. Your function definition is contained in a binary format (that was compiled by your C++…
