Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Corruptinator |
Does anybody with good knowledge in GDNative (C++) happen to know how to convert an interger to string? I’ve ran into compiling errors trying to get it to work:
gdtest.cpp:
#include <iostream>
#include <string>
#include <cmath>
using namespace godot;
using namespace std;
String math(){
int number = 6;
return godot::String(to_string(number));
}
This is what the error says:
src\gdtest.cpp(11): error C2440: '<function-style-cast>': cannot convert from 'std::string' to 'godot::String'
Any info on how to convert to string would be great! Thanks!