You have several problems. Go through and verify that all your code is within a function, it's not you have a large part in the middle not in a function. Check that you don't have 2 different functions with the same name, you declare getjobs(); as both an int and a void function. Check that you have semicolons, brackets and other syntax correct. Also, do not use global variables unless they are constant. You need to pass them to the functions that use them. Your big lines of stars do help to break up your code, it would be nice to see more explanation in your comments, it's currently very choppy.