Most short programs are completely contained within one source file. However, as a
program's length grows, so does its compile time (and long compile times make for
short tempers). Hence, C/C++ allows a program to be contained in many files and lets
you compile each file separately. Once you have compiled all files, they are linked,
along with any library routines, to form the complete object code. The advantage of
separate compilation is that if you change the code of one file, you do not need to
recompile the entire program. On all but the simplest projects, this saves a substantial
amount of time. The user documentation to your C/C++ compiler will contain
instructions for compiling multifile programs
program's length grows, so does its compile time (and long compile times make for
short tempers). Hence, C/C++ allows a program to be contained in many files and lets
you compile each file separately. Once you have compiled all files, they are linked,
along with any library routines, to form the complete object code. The advantage of
separate compilation is that if you change the code of one file, you do not need to
recompile the entire program. On all but the simplest projects, this saves a substantial
amount of time. The user documentation to your C/C++ compiler will contain
instructions for compiling multifile programs
No comments:
Post a Comment