Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int *str_int(char *str, int count, char *img)
- {
- int i = 0;
- int j = 0;
- int *intstr;
- int columns;
- int lines;
- intstr = xmalloc(sizeof(intstr) * count);
- while (str[i] != '\0')
- {
- if (str[i] <= '9' && str[i] >= '0')
- {
- intstr[j] = str[i] - '0';
- i++;
- if (str[i] <= '9' && str[i] >= '0')
- intstr[j] = intstr[j] * 10 + str[i] - '0';
- j++;
- }
- else
- i++;
- }
- columns = count_columns(str);
- lines = count_lines(str);
- place_xy(intstr, columns, lines, img);
- return (intstr);
- }
Add Comment
Please, Sign In to add comment