"C언어 strtok()"의 두 판 사이의 차이

(새 문서: ==개요== ;C언어 strtok() <source lang='console'> #include <stdio.h> #include <string.h> int main() { char string[] = "a string, of, ,tokens\0,after null terminator"; ch...)
 
34번째 줄: 34번째 줄:
* https://www.ibm.com/support/knowledgecenter/ko/ssw_ibm_i_73/rtref/strtok.htm
* https://www.ibm.com/support/knowledgecenter/ko/ssw_ibm_i_73/rtref/strtok.htm


[[분류: 명사]]
[[분류: C]]
[[분류: 분류1]]
[[분류: 문자열]]
[[분류: 분류2]]
[[분류: string.h]]

2017년 11월 24일 (금) 00:39 판

1 개요

C언어 strtok()
#include <stdio.h>
#include <string.h>
 
int main() {
    char string[] = "a string, of, ,tokens\0,after null terminator";
    char *token;
    token = strtok(string, ",");
    do {
        printf("token: [%s]\n", token);
    }
    while( token = strtok(NULL, ",") );
}
// token: [a string]
// token: [ of]
// token: [ ]
// token: [tokens]

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}