Re: header files

Joseph Hadzima <[email protected]> Thu, 19 May 2005 06:28:45 -0700 (PDT)
Newsgroups gmane.comp.programming.cppug
Message-ID <[email protected]>
I consider procedures as independent from methods which are
contained in a class.  If these are procedures callable
from anyother procedure, or from a class method, then all
you need to do is:

g++ Main.cpp Class1.cpp Class2.cpp ManyProcedures.cpp -o
MyApplication.exe

where -o MyApplication.exe is the name of the final
executable file, and each source file (*.cpp) should
include the usual header files

#include "ManyProcedures.h"
#include "Main.h"
#include "Class1.h"
#include "Class2.h"

and each *.h file shold have gaurds such as:

#ifndef _MyHeaderFileName_H_
#define _MyHeaderFileName_H_

// rest of header file code goes here

#endif _MyHeaderFileName_H_  // last line in header file.



hope this helps


--- joshua henry moses <[email protected]>
wrote:

---------------------------------
 i wrote a really lengthy program in c++, with lots of
procedures. i want to place thaprocedures on seperate
file.can i save it as separate header file or c++
file?
and how can i include it in my main program?



HADZ.

The reasonable man adapts himself to the world; 
the unreasonable one persists in trying to adapt 
the world to himself. Therefore all progress depends 
on the unreasonable man. 
    --George Bernard Shaw, Man and Superman (1903) 
"Maxims for Revolutionists" Irish dramatist & socialist (1856 - 1950)


(this email sent using 100% recycled electrons)


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/cppug/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/