Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main()
- {
- char str[] = " 123.42 623.552 \r\n0.342 -0.001";
- char * pch;
- pch = strtok (str," \r\n");
- while (pch != NULL)
- {
- double d = strtod(pch, NULL);
- printf ("%s [%f]\n",pch, d);
- pch = strtok (NULL, " \r\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement