C - Is this the right way to use strtok in the following situation -
if have string contains 10x15. , want separate 10 , 15. following code correct. concerned second part of code, putting "null" there right thing do.
char * stringsixrows = strtok(stringsix[0], "x"); char * stringsixcollumns = strtok(null, "null");
//i put second null there cause end of string, im not sure if right though.
i'd "canonical" way obtain "pointer remaining string" is:
strtok(null, "")
strtok
searches any of delimiters in provided string, if don't provide delimiters, cannot find , stops @ end of input string.
Comments
Post a Comment