✅ 목표 (Goal)

✅ 참조 (Ref.)

https://yaraba.tistory.com/618

문자열에서 특정 항목을 추출하는 방법

    #define DELIMITER ","
    char str1[64] = "No smoke without fire."; // 아니 땐 굴뚝에 연기나랴
    char str2[64] = "The worst wheel of the cart always creaks most."; // 가장 나쁜 바퀴가 가장 삐걱거린다.
    char str3[64] = "aaa,bbb,ccc,ddd";
    printf("original: \\"%s\\"\\n", str3);

    char* ptr = strtok(str3, DELIMITER); // DELIMITER 기준으로 문자열을 자른후 주소를 반환한다.
    unsigned int tmp_cnt = 0;
    printf("parsed : \\n");
    while (ptr != NULL) {
        printf("[%d] %s\\n", ++tmp_cnt, ptr);
        ptr = strtok(NULL, DELIMITER); // 다음 문자열을 자르고, 또 주소를 반환
    }