Noob question

So I asked chatGPT to help me get started with C++ in unreal engine.
I asked it that i wanted to print “hello world” in game on the screen.
ive placed the actor in the world, hit play, but there is no message.

Is there something wrong with the code?

It looks ok to me - is it possible your messages are disabled? You can check the Output log as well - it gets printed there too.