How to print strings in c++ console?

How to print strings in c++ console?
It seems that ‘cout<<“hello word!”<<endl;’ didn’t work.

2 Likes

Which console do you mean? If the unreal console(“Output Log”), see below.

new link:

Console Log:



UE_LOG(LogTemp, Warning, TEXT("Your message"));
UE_LOG(YourLog, Warning, TEXT("This is a message to yourself during runtime!"));


On Screen:



GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("This is an on screen message!"));
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Some variable values: x: %f, y: %f"), x, y));


13 Likes

Very late reply, but to print on screen you can also use UKismetSystemLibrary::PrintString

Thank you for your help!