Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int
- main(int argc, const char *argv[])
- {
- char *str = "0000fd23a:12:05 [localhost] request [LenStr] Привет :P";
- char *position = NULL, *nick = NULL, *message = NULL;
- long unsigned int pos = 0;
- int hour = 99, minutes = 99;
- sscanf(str, "%lx:%d:%d [%s] %*s", &pos, &hour, &minutes, nick, message);
- printf("pos=%li, time=%i:%i, nick=%s, message=%s\n", pos, hour, minutes, nick, message);
- return 0;
- }
Add Comment
Please, Sign In to add comment