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

char getDesDirchar data char p = NULL; p = strtokdata ; p = strtokNULL ; 这里的第一个参数是要分割的字符串 为什么要带NULL return p;

原文地址: http://www.cveoy.top/t/topic/iiso 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录