• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[C++] How to convert an uint32_t to string.

KylerXX

Active Member
Joined
Jun 24, 2010
Messages
439
Reaction score
30
Well, I need this request, if someone knows this please post. <_<
 
uint32_t x = 5;
std::stringstream ss;
std::string ret;
ss << x;
ss >> ret;
 
I have added this:
Lua:
uint32_t p5 = 97;
uint32_t p15 = 1613;
uint32_t rath1 = random_range(p5, p15);
std::stringstream ss;
std::string ret;
ss << rath1;
ss >> ret;
I dont know if random_range returns an uint32_t value :/
But gets this error
Code:
../.....cpp:649: error: invalid conversion from `uint32_t' to `const char*'

../.....cpp:649: error:   initializing argument 1 of `std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]'
 
Last edited:
Back
Top