Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <inttypes.h>
- int main(int argc, char* argv[]) {
- uint64_t result = 0;
- char * str = argv[1];
- if (argc > 1) {
- while (*str) {
- char *end;
- uint64_t b = 1;
- long val = strtoll(str, &end, 8);
- if (*str != *end) {
- str = end;
- val -= 1;
- result |= b << val;
- }
- if (*str || str == end) {
- str +=1;
- }
- }
- }
- printf("%" PRIx64 "\n", result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement