Separate Compilation
Separate Compilation

Here is what the program we just wrote would look like if it were all in one file. Nasty isn't it.

To make this program a little more managable it can be divided up into three separate files:

After you have created all the files, you compile them together by using the -c switch with cc. Here is a sample run: [irix2]> cc -c projsplit.c [irix2]> cc -c lucky.c [irix2]> cc projsplit.o lucky.o [irix2]> a.out ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A recent discovery has been made connecting your birthday to your winning Lottery numbers. Here is a program to get your personal lucky numbers. Enter in your Birthday as a 6 digit number (this program assumes that you can handle this in an error-free style). Enter 0 will quit the program. Have fun!!! WARNING: You may get repeats! Other people have to have some numbers to be lucky with too!! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Please enter your Birthday (mmddyy) or 0 to Quit: 020345 How Many Lucky Numbers Do You Need? 4 70 93 6 1 Please enter your Birthday (mmddyy) or 0 to Quit: 234567 You don't know your own Birth Date?!?!?!?!?! Please enter your Birthday (mmddyy) or 0 to Quit: 111778 How Many Lucky Numbers Do You Need? 10 23 92 61 70 22 98 84 17 78 47 Please enter your Birthday (mmddyy) or 0 to Quit: 0 [irix2]>


Main Page