int main()
{
std::string text = "easy C++ lan";
std::string space_delimiter = " ";
std::vector<std::string> words{};
size_t pos = 0;
while ((pos = text.find(space_delimiter)) != string::npos) {
words.push_back(text.substr(0, pos));
text.erase(0, pos + space_delimiter.length());
}
for (const auto &str : words) {
std::cout << str << std::endl;
}
}
'C++ > C++ 코드 기록' 카테고리의 다른 글
모든 자식 핸들 정보 구하는 코드 (0) | 2024.05.31 |
---|---|
레지스트리에 데이터 쓰기. (0) | 2024.04.04 |
64bit OS인지 체크 하는 코드. (IsWow64Process()) (0) | 2024.01.12 |
메모장에서 한글 읽어올 때 깨짐 현상 (0) | 2024.01.03 |
실행 파일이 있는 경로명 구하기, 메모장에서 한줄씩 읽어오는 코드. (0) | 2023.12.30 |