That is because PrintLine
works with passing a single FString
.
I think you misunderstand what the macro does. The macro just adds a prefix or nothing at all. It’s needed to turn a string literal into the correct string literal type for the targeted platform as Unreal uses Unicode and different platforms use different character types to store Unicode Code Points.
FString
stores a TArray<TCHAR>
where TCHAR
is the correct character type for the targeted platform. For Windows that’s wchar_t
, others might use char
or char16_t
.
"Hello"
Is of type const char[6]
L"Hello"
is of type const wchar_t[6]
. That is what the TEXT
macro does on Windows, it prepends an L. On different platforms it might prepend u
or do nothing at all. But it’ll be correct whatever the platform is being compiled for.
No because of the first point. FString
is only needed to be dereferenced to get a const TCHAR*
which is needed for Printf