How to use strtok

Hello, please help me...

I have a problem with strtok

char a[5] = "1.2";

I get number "1" use printf("%s", strtok(a, "."));
but how to get number "2" with strtok ?
You might want to read what it does first.
http://pubs.opengroup.org/onlinepubs/007908799/xsh/strtok.html
closed account (zb0S216C)
Simply put, it splits a string into tokens when the delimiter is reached. In this case, the delimiter is ".".

EDIT: I've answered your other post: http://www.cplusplus.com/forum/general/34976/
Last edited on
Topic archived. No new replies allowed.