**variable

Could enybody please give some detailed information about why we are using double asterix in here -

as i understood we deferencing twice because we have an array of symbols in our FString variable that is also needs to be dereferenced to be printed out. Therefore the pointer to that variable needs to be dereferenced twice

I’m also learning and I think you are right that is the reason for that :+1:

but why we are using deference operator to print out strings while in standart c++ we can just call variable and print it out without dereferencing. I know that in classic C we need to dereference " char* " type variables becaouse they are like array of symbols. It is kind of low level operation.

how can you print variables without dereferencing ?? as I know I need to put %s inside the quotation mark “%s” then I put * so indicate the variable …

FString has overloaded the * operator
FString::operator* | Unreal Engine Documentation

It needs to be dereferenced once to get the value the pointer points to and then again to get the const TCHAR* needed for UE_LOG as it uses printf internally.

std::string has a similar functionality via the data() member function.

Demo: Compiler Explorer

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.