본문 바로가기

Coding/궁금한 것들

string을 int로, int를 string으로

string to int -> stoi 함수

ex) int num = stoi(str);

 

int to string -> to_string 함수

ex) string str = to_string(num);

'Coding > 궁금한 것들' 카테고리의 다른 글

using namespace std를 쓰면 안되는 이유?  (0) 2019.10.15
c++ memset을 피해야하는 이유?  (0) 2019.09.30
삼항 연산자  (0) 2019.09.10
typedef  (0) 2019.09.06
cin.tie() / sync_with_stdio()  (0) 2019.09.06