ToCStr

Gets a non-owning TCHAR pointer from a string type.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Containers/UnrealString.h

Include

#include "Containers/UnrealString.h"

Syntax

const TCHAR * ToCStr
(
    const TCHAR * Ptr
)

Remarks

Gets a non-owning TCHAR pointer from a string type.

Can be used generically to get a const TCHAR*, when it is not known if the argument is a TCHAR* or an FString:

template =""> void LogValue(const T& Val) { Logf(TEXT("Value: %s"), ToCStr(LexToString(Val))); }

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss