C strtok() Function with NULL Argument: Tokenizing String Parts
The first argument of `strtok` is the string to be tokenized, and the second argument is a string containing all the delimiters. In this code, the first call to `strtok` tokenizes the string `data` using space as the delimiter. The second call to `strtok` continues tokenizing the remaining part of the string, but instead of providing the original string `data` again, `NULL` is passed as the first argument. Passing `NULL` as the first argument tells `strtok` to continue tokenizing the same string that was tokenized in the previous call. It allows the function to continue where it left off and tokenize the remaining part of the string.
原文地址: https://www.cveoy.top/t/topic/p0Cy 著作权归作者所有。请勿转载和采集!