Header Files
Hi there,
I have a it experience with C++ and am still learning. But I''ve never came across Header files. Now for my programming team I''ve written a error logging class(Simple one) and I want to split it up in a heaader and cpp file. How do I do this and how do the files look like. What I want is just this:
#include "errorlog.h"
// Do other stuff here
How does the .H file look like and how does the cpp file look like. I also want to distribute it as an precompiled header on the team site, how do I create an precompiled header?(Using VC++ 6 Enterprise).
Thanx in advance,
Sand Hawk
Member of the Stupid Coders.
http://www.stupidcoders.cjb.net
-Earth is 98% full. Please delete anybody you can.
Something like:
Header file:
and the cpp file...
Hope this helps some....if you''re stuck, check out a good C++ book.
Regards,
RM.
Tron Software
-=Kicking Butt and Writing Code=-
Header file:
#include <iostream.h>#ifndef CLASS_ERROR_HEADER#define CLASS_ERROR_HEADERclass CError{ public: CError(); ~CError(); void LogError(char *error); void DisplayError(void); private: // whatever storage variables you want....}#endif
and the cpp file...
#include "CError.h"#ifndef CLASS_CERROR_IMP#define CLASS_CERROR_IMPCError::CError(){ // whatever code...}CError::~CError(){ // whatever code...}void CError::LogError(char *error){ // whatever code...}void CError::DisplayError(void){ // whatever code...}#endif
Hope this helps some....if you''re stuck, check out a good C++ book.
Regards,
RM.
Tron Software
-=Kicking Butt and Writing Code=-
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement