Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<unistd.h>
  4.  
  5.  
  6. void print_int(int n)
  7. {
  8. char c = (char)(((int)'0')+n);
  9. write(1,&c,1);
  10. }
  11.  
  12. int main(int argc, char *argv[])
  13. {
  14. int i, j=0;
  15. if(argc >1)
  16. {
  17. while (argv[1][j] != '\0')
  18. {
  19. i = ((int)(argv[1][j])-48);
  20. print_int(i);
  21. j++;
  22. }
  23. }
  24.  
  25. return(0);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement