I CANNOT FIGURE OUT HOW TO CONVERT AN INTEGER TO A STRING!!!!!
I am simply trying to get this code to work:
int number = 43;
Godot::print(number);
But it prints nothing every time.
I just want it to be able to print the value of a variable to the Godot Engine.
If I do:
Godot::print("Hello");
It will work every time without a hiccup.
Is there a method I am not using? Is there a header file I could be missing? I've been sampling and have tried everything I feel like. I dont have access to the itos()
method for some reason, although I see it in the codebase at times and I know it would solve my issue. I have tried variations of the std namespace
(which doesnt work), I have tried multiple things with Godot::String
... and it doesnt work.
Does anyone happen to know a fix to this? I feel like it might be something simple but I have been spending hours on this and cannot find an answer anywhere.
One solution online also used godot::String( to_string(number).c_str() );
but I didn't have access to the .c_str()
method... I am not sure where (or what header) it came from.
You would be a LIFESAVER if you knew why this may be. I am fairly confident my project is setup correctly because just about everything else works perfectly.