Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 293 Bytes

03_문자열을 정수로 변환.md

File metadata and controls

18 lines (12 loc) · 293 Bytes

정수를 문자열로 변환

int 형을 string 형으로 변할 때는 <string> 헤더 파일의 stoi() 함수를 사용합니다.


#include <string>
#include <iostream>

void main() {
	string s = "100";
    int i = stoi(s);
    
    cout << i << endl;	// output: 100
}