In Section 7.128 @ 11:20 He mentions that we have to dereference the FRotator so it can be put into a string. Can someone help explain why. I’m certain he mentioned it earlier in the course but I cannot find it.
Not necessarily a char. You can convert anything to and from a string with the right conversion code.
I’m not looking up the course video at the moment but if you have to do something and have no choice then its because Unreal did it in the first place to cause you to have to no matter how great or silly it is. That’s one of those problems with 3rd party APIs.
Well, there’s several bad problems with APIs that and certain companies change it constantly causing devs headaches like Epic when they could code it to not cause devs headaches. Vicious.
It’s not FRotator but the FString function .ToString() returns. UE_LOG is using printf under the hood which uses an array of chars, it has no concept of the FString type.
FString provides a way to get its internal array by the * operator. std::string has the same functionality with .data()
std::string example = "Hello";
printf(example.data());
compiled output: https://godbolt.org/z/kc8-vP