Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void) {
- char a[] = "00 05 10 15 20";
- int b[5], i;
- sscanf(a, "%d%d%d%d%d", &b[0], &b[1], &b[2], &b[3], &b[4]);
- for (i = 0; i < 5; i++) printf("b[%d] = %d\n", i, b[i]);
- char c[] = "00,05,10,15,20";
- int d[5];
- sscanf(c, "%d,%d,%d,%d,%d", &d[0], &d[1], &d[2], &d[3], &d[4]);
- for (i = 0; i < 5; i++) printf("d[%d] = %d\n", i, d[i]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement