### cplusplus

Controls whether or not to translate subsequent source code as C or C++ source code.

##### Syntax

#pragma cplusplus on | off | reset

##### Targets

All platforms.

##### Remarks

If you enable this pragma, the compiler translates the source code that follows as C++ code. Otherwise, the compiler uses the suffix of the filename to determine how to compile it. If a file name ends in .c, .h, or .pch, the compiler automatically compiles it as C code, otherwise as C++. Use this pragma only if a file contains both C and C++ code.

NOTE The Carbide C/C++ compilers do not distinguish between uppercase and lowercase letters in file names and file name extensions except on UNIX-based systems.

This pragma corresponds to the Force C++ Compilation setting . To check this setting, use __option (cplusplus), described in Checking Settings. The default setting is off.