Re: classes & files

From: Albert (a_dubbelhuis_at_hotmail.com)
Date: 02/20/04


Date: Fri, 20 Feb 2004 16:33:50 +0100

thanks... this is a great help for me
"Francis Glassborow" <francis@robinton.demon.co.uk> schreef in bericht
news:iFzBlwYmdPNAFwHC@robinton.demon.co.uk...
> In message <dl6Zb.13649$Do3.10010@newssvr31.news.prodigy.com>, Thomas
> Matthews <Thomas_MatthewsSpitsOnSpamBots@sbcglobal.net> writes
> >Albert wrote:
> >
> >> Hello,
> >> I've got a question.
> >> I want to program something like this:
> >> classA.h:
> >> class classA
> >> {
> >> public:
> >> classA();
> >> ~classA();
> >> };
> >> classA.cpp
> >> #include "classA.h"
> >> classA::classA() {}
> >> classA::~classA() {}
> >> and now I want a different file for main. like
> >> mainA.cpp:
> >> #include "classA.cpp"
> >
> >Here is the root cause of the problem.
> >Don't include the source file if you compile
> >the file individually.
>
> But do include the header file (it is what they are for) so that line
> should have been:
>
> #include "classA.h"
>
>
> --
> Francis Glassborow ACCU
> Author of 'You Can Do It!' see http://www.spellen.org/youcandoit
> For project ideas and contributions:
http://www.spellen.org/youcandoit/projects