---
name: "CPP File Format"
type: topic
source: https://community.bistudio.com/wiki/CPP_File_Format
revid: 373452
updated: 2025-05-08T11:44:17Z
---

# CPP File Format

The `.cpp` file extension is a generic identifier that *indicates* the contents contain pre-raPified text and *can* be raPified (binarised).
This is by convention only - the actual content could be binarised already and the engine would load it without failure.

> [!NOTE]
> The binarised (raPified) equivalent of `.cpp` file is `.bin` - see [Config.cpp/bin File Format](../topics/Config.cpp~2Fbin_File_Format.md).

There are currently several cpp/bin files used by Bohemia Interactive:

- [Config.cpp/bin](../topics/Config.cpp~2Fbin_File_Format.md)
- [Mod.cpp/bin](../topics/Mod.cpp~2Fbin_File_Format.md)
- [Product.cpp/bin](../topics/Product.cpp~2Fbin_File_Format.md)
- [Resource.cpp/bin](../topics/Resource.cpp~2Fbin.md) - Operation Flashpoint only

### Syntax

Values are set in the following format: `valueName = value;` - a semicolon always ends the line.
They can be present at the root of the file but more frequently than not will be defined in a **class** - note that **classes are also ended by a semicolon**.

```cpp
class MyConfigClass
{
    intValue = 42;
    floatValue = 66.6;
    stringValue = "text";
    translatedValue = "$STR_MyStringtableKey"; // quotes are good practice
    arrayValueColour[] = { 1, 0, 0, 1 };
    arrayValueRandom[] = { "ValuesCanBeMixed", 1, 42.0, { 0, 1, 0, 1 } };

    class MySubConfigClass // subclasses are possible
    {
        subValue = 123456;
    };
}; // a semicolon ALWAYS closes a class
```

There are **no boolean value** in config; you can define them for ease of use/readability using `#define`, usually in the first lines:

```cpp
#define true 1
#define false 0

class MyConfigClass
{
    // ...
    useTexture = true; // would have otherwise to be useTexture = 1;
    // ...
};
```

A commonly-edited config file is [Description.ext](../topics/Description.ext.md), a file storing scenario settings - the file extension differs but the syntax remains the same.

<sub>Source: [BI Community Wiki — CPP File Format](https://community.bistudio.com/wiki/CPP_File_Format) (revision 373452).</sub>
