Study/Data Structure
string을 integer로 변환(stringstream 사용)
Vjerksen
2018. 5. 10. 16:12
참고(Reference)
- stringstream에 대한 설명 : http://word.tistory.com/24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<sstream> | |
using namespace std; | |
inline int make_num(string str){ | |
stringstream sstream; | |
int num; | |
sstream.str(str); | |
while(sstream >> num); | |
return num; | |
} |
※ 정확하고 부드러운 태클은 언제나 환영입니다.