개발팁

c++ string

은찐찐 2019. 2. 11. 17:08

string temp = "abcdefg" ;

cout << temp.at(0) << endl;

cout << temp[0] << endl;


결과 a 로 같다


string to int

num=stoi(str) // string 헤더에서 stoi 지원

vs

int to string

string str = to_sstring(int);