> For the complete documentation index, see [llms.txt](https://docs.oserosuite.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oserosuite.com/technical-notes/unreal-engine-notes/editor-engine/get-engine-version-in-c++.md).

# Get Engine Version in C++

```cpp
// #if ENGINE_MAJOR_VERSION >= 4 && ENGINE_MINOR_VERSION >= 19 || ENGINE_MAJOR_VERSION == 5
// Is equal to
#if UE_VERSION_NEWER_THAN(4, 19, -1)
// but whole block can be reversed using UE_VERSION_OLDER_THAN macro
#if ENGINE_MAJOR_VERSION >= 4 && ENGINE_MINOR_VERSION >= 19 || ENGINE_MAJOR_VERSION == 5
    // Some Code for UE4.19 and newer versions
#else
    // Some code for pre UE4.19 versions
#endif
// will be equivalent to
#if UE_VERSION_OLDER_THAN(4, 19, 0)
    // Some code for pre UE4.19 versions
#else 
    // Some Code for UE4.19 and newer versions
#endif
```

{% hint style="info" %}
\#define <mark style="color:purple;">ENGINE\_MAJOR\_VERSION</mark> 5\
\#define <mark style="color:purple;">ENGINE\_MINOR\_VERSION</mark> 2\
\#define <mark style="color:purple;">ENGINE\_PATCH\_VERSION</mark> 1

This means it’s version 5.2.1.
{% endhint %}

### Reference

{% embed url="<https://medium.com/@igor.karatayev/correct-way-to-check-unreal-engine-version-in-code-428c4adfa245>" %}
