Download

How to print strings in c++ console?

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

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

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));