#include <ssteram>
using namespace std;

string str = "find new";
stringstream in(str);
string a, b;
in >> a >> b;

// a = "find"
// b = "new"

활용시 참고

https://life-with-coding.tistory.com/403

 

[C++] stringstream 사용법

인트로 안녕하세요. 오늘은 C++의 Stringstream 사용법에 대해 포스팅하겠습니다. C++에서 여러가지 자료형이 한 줄에 들어오면 파싱해서 용도에 맞게 사용할 필요가 있는데요. 특히 "이름 날짜 내용"

life-with-coding.tistory.com

 

+ Recent posts