Guest User

Untitled

a guest
Aug 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. int *str_int(char *str, int count, char *img)
  2. {
  3. int i = 0;
  4. int j = 0;
  5. int *intstr;
  6. int columns;
  7. int lines;
  8.  
  9. intstr = xmalloc(sizeof(intstr) * count);
  10. while (str[i] != '\0')
  11. {
  12. if (str[i] <= '9' && str[i] >= '0')
  13. {
  14. intstr[j] = str[i] - '0';
  15. i++;
  16. if (str[i] <= '9' && str[i] >= '0')
  17. intstr[j] = intstr[j] * 10 + str[i] - '0';
  18. j++;
  19. }
  20. else
  21. i++;
  22. }
  23. columns = count_columns(str);
  24. lines = count_lines(str);
  25. place_xy(intstr, columns, lines, img);
  26. return (intstr);
  27. }
Add Comment
Please, Sign In to add comment