Tuesday, September 20, 2005

Re: 3 files = 1 program HELP!!!!


If these are the three files only then the way u included the file.h in
both driver.cpp and file.cpp does not give us much details.

.h files or header files are specifically used to give declarations of
global variables,classes and functions. (but programmer may tailor it
according its need). so these header files should be included in the
cpp files that are either givings definitions of functions or are using
these functions. if any cpp file is not using the functions or
variables delared in header file we need not include that header file
in the cpp file.

As far as the whole integration is concerned each cpp file is compiled
separately ( during this the compiler only verfies whether the
functions that are used are declared and are appropriate) so comes the
role of header file. But during the linking phase all the complied
files are linked togetherand integrated into single program.

Any way as BlueRaja said for further details u have to study some
tutorials related to compiling and linking.

0 Comments:

Post a Comment

<< Home