Welcome to the Ranch
My! Good grief! What a mass of illegible code. Please post it again without the
long lines, with spaces after every comma (in multiple declarations use new lines), and spaces round the binary operators. Break the main() function into smaller functions.
What do you mean about the main function stopping working? Do you suffer a segmentation fault?
What do the different if statements mean? What does pos_int mean when expressed as an int? Does the bang operator ! turn anything non‑zero to 0? How does pos_int differ from *pos_int? Are you using while (pos_int) when
you should use while(*pos_int)?