C++ Linkage specifications

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

A linkage specification tells the compiler to compile declarations in a way that allows them to be linked together with declarations written in another language, such as C.

Syntax

  • extern string-literal { declaration-seq(opt) }
  • extern string-literal declaration

Remarks

The standard requires all compilers to support extern "C" in order to allow C++ to be compatible with C, and extern "C++", which may be used to override an enclosing linkage specification and restore the default. Other supported linkage specifications are implementation-defined.



Got any C++ Question?