Notice
Recent Comments
목록프로그래밍/C (1)
Elex
strtok()
C에서 StringTokenizer를 사용해서 문자열을 분리할 수 있다. 함수명은 strtok()... #include #include int main() { char text[] = "N01 G00 X10.0 Y10.0"; char splitter[] = " "; char *splitedText; // Split with the white spaces... splitedText = strtok(text, splitter); while (splitedText != NULL) { //Add your codes to precess the splitted string... printf("%s\n", splitedText); splitedText = strtok(NULL, splitter); } }
프로그래밍/C
2010. 5. 24. 23:57