Guest User

Untitled

a guest
Jun 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. /* Using strtoul */
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. int main()
  5. {
  6. unsigned long x;
  7. const char *string = "1234567abc";
  8. char *remainderPtr;
  9. x = strtoul ( string, &remainderPtr, 0 );
  10. printf( "%s\"%s\"\n%s%lu\n%s \"%s\"\n%s%lu\n",
  11. "The original string is ", string,
  12. "The converted value is ", x,
  13. "The remainder of the original string is ",
  14. remainderPtr,
  15. "The converted value minus 567 is ", x - 567 );
  16. return 0;
  17. }
Add Comment
Please, Sign In to add comment