[C++] String <-> Int 변환
1. string -> int로 변환 (stdlib.h 필요) - atoi(XX.c_str()); - stoi(str); 2. int -> string으로 변환 :to_string(YY); #include #include #include using namespace std; int main() { //출력: 123 369 string str = "123"; int a = atoi(str.c_str()); int b = 246; cout