Hello there, I try to tokenize a string. "Normally" (which means on my normal PC) I use the strtok() function to tokenize my string. But Keil uV does not support this function in there stdlib. Any suggestions how to tokenize a string into its values? The string is of this format: "123 456 789 012" I want to get four integers with the values "123", "456", "789" and "012". If a single space as delimiter causes problems, it will be now problem to replace it to a tab "\t" or to any other delimiter. Thanks for any help and/or hints to solve my problem... Alexander
strtok is included since about 3 years in the run-time library. See: http://www.keil.com/support/man/docs/c51/c51_strtok.htm Reinhard
"... this function in there stdlib." If by "stdlib" you are implying stdlib.h, then you should be looking at string.h instead.
"The string is of this format: "123 456 789 012" I want to get four integers with the values "123", "456", "789" and "012"." If this is really what you want to do, why not just use sscanf()?
"If this is really what you want to do, why not just use sscanf()?" If this is really all you want to do, wouldn't a simple loop suffice?
Hi, thanks for your reply and excuse my late answer. I'm using a very old version of uVision and in this version (2.1) strtok() isn't included into string.h But i was able to solve my problem with sscanf(). Thanks for your help. regards Alexander