숫자 ( 1 ) std::string . 숫자 . stoi, stof, stol,stod, to_string std::string 을 숫자로 stoi, stof, stol , stod : std::string 을 int, float, long, double 로 간단 변환. 주의 : stoi 같은 경우 최대 10자리 정수까지만 변환된다. // C++11 부터. #include std::string my_str_i = "12345"; std::string my_str_i2 = "1234567890123456"; int i = std::stoi(my_str_i); // 정수로. base 지정하지 않으면 최대 10자리까지 정수변환. int64_t = std::stoi(my_str_i2); //주의 : 문자열 앞에서 부터 10개만 숫자로 변환됨. 숫자를 std::string 으로 to_string() #include i.. 2022. 2. 23. 이전 1 다음