C++11

// <string>
long long stoll (const string& str, size_t* idx = 0, int base = 10);
​long long stoll (const wstring& str, size_t* idx = 0, int base = 10);

将字符串转化成带符号整数。