ToCStr

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

Choose your operating system:

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))); }