[IT]/알고리즘
[알고리즘] C++ split() 하는 초간단한 방법
working_hard
2019. 6. 7. 17:04
728x90
#include<iostream>
#include<cstring>
#include<vector>
using namespace std;
int main() {
char str[] = "00:12:34";
int cnt = 0;
char *context = NULL;
char *token = strtok_s(str, ":", &context);
while (token) {
cout << token << endl;
token = strtok_s(NULL, ":", &context);
}
}
