「C++」stoi()でStringからintに変換するサンプル
サンプルコード
#include <stdio.h>
#include <string>
int main() {
std::string cftStr = "5678";
int num;
num = stoi(cftStr);
printf("変換結果:%d\n", num);
return 0;
}
変換結果:5678
Coding Changes the World
サンプルコード
#include <stdio.h>
#include <string>
int main() {
std::string cftStr = "5678";
int num;
num = stoi(cftStr);
printf("変換結果:%d\n", num);
return 0;
}
変換結果:5678