# How to print strings in c++ console?

**URL:** <https://forums.unrealengine.com/t/how-to-print-strings-in-c-console/48777>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [November 30, 2015, 3:43am UTC](https://forums.unrealengine.com/t/how-to-print-strings-in-c-console/48777 "2015-11-30T03:43:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_71046e02](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_71046e02](https://forums.unrealengine.com/u/anonymous_user_71046e02)\
**Post date:** [November 30, 2015, 3:43am UTC](https://forums.unrealengine.com/t/how-to-print-strings-in-c-console/48777/1 "2015-11-30T03:43:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![namrog84](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/namrog84/32/1160009_2.png) [@namrog84](https://forums.unrealengine.com/u/namrog84)\
**Post date:** [November 30, 2015, 4:23am UTC](https://forums.unrealengine.com/t/how-to-print-strings-in-c-console/48777/2 "2015-11-30T04:23:31Z")

</div>

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

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

new link:

> **[Logs, Printing Messages To Yourself During Runtime | Unreal Engine Community...](https://unrealcommunity.wiki/logs-printing-messages-to-yourself-during-runtime-n5ifosqc)**
>
> @alert info This is a legacy article imported from the old wiki. An updated version can be found here: \[Not Created Yet\] @endalert Overview Logs are essential for giving yourself feedback as to whe...

Console Log:

```auto

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

```

On Screen:

```auto

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

```

---

<div class="post-metadata">

**Author:** ![The\_untextured](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@The\_untextured](https://forums.unrealengine.com/u/The_untextured)\
**Post date:** [April 18, 2024, 8:50pm UTC](https://forums.unrealengine.com/t/how-to-print-strings-in-c-console/48777/3 "2024-04-18T20:50:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![deviilish](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@deviilish](https://forums.unrealengine.com/u/deviilish)\
**Post date:** [July 10, 2024, 9:05pm UTC](https://forums.unrealengine.com/t/how-to-print-strings-in-c-console/48777/4 "2024-07-10T21:05:37Z")

</div>

> [@namrog84](#):
>
> `GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("This is an on screen message!"));`

Thank you for your help!
