diff -r 80ef3a206772 -r 48780e181b38 Symbian3/SDK/Source/GUID-006C503D-1E52-450D-A4DA-8C19B141E09F.dita --- a/Symbian3/SDK/Source/GUID-006C503D-1E52-450D-A4DA-8C19B141E09F.dita Fri Jul 16 17:23:46 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-006C503D-1E52-450D-A4DA-8C19B141E09F.dita Tue Jul 20 12:00:49 2010 +0100 @@ -15,7 +15,7 @@ where C and C++ (and Symbian C++ as well) codes will be used together. The open source community implements a vast number of libraries that export C APIs to the user of such libraries. -
When +<section id="GUID-88635D46-AEF6-4E8E-969D-D3E56941F289-GENID-1-10-1-13-1-1-5-1-3-1-7-1-4-1-4-1-3-1"> <title>When and why to use C linkage

While porting such applications, if developers have to intermix C and C++ code, they then have to depend on C++ language features like extern "C" for giving C linkage to some set of @@ -32,7 +32,7 @@ It applies when the developer tries to use C APIs by including corresponding headers. To avoid name mangling, the developer should mention explicitly that those APIs are C APIs, by using the extern "C" keyword.

-
Syntax +<section id="GUID-88635D46-AEF6-4E8E-969D-D3E56941F289-GENID-1-10-1-13-1-1-5-1-3-1-7-1-4-1-4-1-3-2"> <title>Syntax of extern C

The syntax of extern "C" is shown below:

extern "C" declaration ;

The declaration (or definition) that immediately follows extern "C" has the C linkage.

extern "C" { @@ -41,7 +41,7 @@ ... }

Everything between the curly braces has C linkage, unless declared otherwise.

-
How +<section id="GUID-88635D46-AEF6-4E8E-969D-D3E56941F289-GENID-1-10-1-13-1-1-5-1-3-1-7-1-4-1-4-1-3-3"> <title>How to use extern C

While writing header files with C functions which will be included by both C and C++ source files, the user must use extern "C" properly. See the example below:

/*File: GoodCHeader.h */ @@ -83,7 +83,7 @@ int ret = Function2(10); }
-
Mixing +<section id="GUID-88635D46-AEF6-4E8E-969D-D3E56941F289-GENID-1-10-1-13-1-1-5-1-3-1-7-1-4-1-4-1-3-4"> <title>Mixing C and C++ features using extern "C"

The developer can use all the features of C++ except templates within C by giving those functions extern "C" linkage. See the example below:

#include <iostream>