使用给定的基数将字符串转换为整数

lea*_*ner 4 c++ integer

什么是C++以下Java代码行的等价物

int x = Integer.parseInt("0010011110", 2);
Run Code Online (Sandbox Code Playgroud)

pep*_*ico 7

std :: stoi(自C++ 11以来):

int x = std::stoi("0010011110", nullptr, 2);
Run Code Online (Sandbox Code Playgroud)