I have this program, dealing with sockets and threading (which is not of concern). There is a main loop inside this program. Currently, there is a lot of messy code inside here. I'd like to sort this out into a few functions, declared in a header file. The problems are:
1. The functions I've wrote use lots of variables from the main program (is there a way to fix this, save for passing 3-6 arguements into each function? most of the variables are already global in the main program)
2. The functions have certain circumstances when they need to break or continue the original main loop from the main program. .. Heh.. Any ideas?
I guess I COULD just make a long, ugly, unorganized, cryptic, single-filed program... Or include ALL the function declarations inside that source (to fix the variable problem).
Are there any tips/tricks to get around situations like this? Thanks for any input...