Why use * when I already converted FVector to string?

In this video code

        AActor* Owner = GetOwner();
	FVector actorlocation = Owner->GetActorLocation();
	FString actorlocationstring = actorlocation.ToCompactString();
	
	UE_LOG(LogTemp, Warning, TEXT("actor location: %s"), *actorlocationstring);

Since we converted actorlocation to string why we have to add * again to print a string in the log ?

UE_LOG does not work with FString. You need to dereference it to get underlying TCHAR* and that is what UE_LOG needs.

3 Likes

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

Privacy & Terms