View Full Version : [SOLVED] string to uint

09-29-2015, 08:31 PM
is there a way to convert a string to a integer?
I have OnChat message broken down into individual table entries:

std::vector<std::string> words = split(msg, ' ');
std::map<uint8, std::string>ChatCache;
for (auto it = words.begin(); it != words.end(); ++it)
k = k + 1;
ChatCache[k] = *it;

If ChatCache[1] = "gtele" then I am expecting ChatCache[2] to be a number.
how would I convert ChatCache[2] to an uint64 value?

09-29-2015, 09:26 PM
ugh lol found ittttttt!!! lol

uint64 loc;
std::istringstream(ChatCache[2]) >> loc;

works perfect now :D

can marked solved

09-29-2015, 09:44 PM
Before I mark it.

k = k + 1;

This isn't Lua. :P

It could be:


Given you can still do that, just pointing that out.