c++ how to convert string to long long

Use the stoll function to convert a string to a long long in C++. Here's an example:

#include <iostream>
#include <string>

int main() {
    std::string str = "12345";
    long long number = std::stoll(str);
    std::cout << number << std::endl;
    return 0;
}