|
-
Nov 25th, 2002, 05:47 PM
#1
Thread Starter
Addicted Member
Build Error when Compiling - how to compile!
Hi,
I am a newbie!
I want to create a DevC++ project that will compile a few classes with their header files in the correct order!
Now I would like to understand something. Should all my class declarations be in a .h file and my class definitions be in a .cpp file?
example:
class Cat
{
private:
int age;
public:
Cat();
~Cat();
}
Now should I include the top class declaration in Cat.h?
how about the functions and methods for Cat class, do they go in my Cat.cpp?
example:
Cat::Cat()
{
cout<<Cat constructed!"<<endl;
}
Cat::~Cat()
{
cout<<Cat destructed!"<<endl;
}
does this code go in my Cat.cpp
do I include "Cat.h" in my Cat.cpp file?
now if i have a few more classes like this, how do i compile them all?
say iw ant to run everything from a main class, which only has my main method
please help.
thank you.
-
Nov 25th, 2002, 06:27 PM
#2
Yes to all your questions that can be answered with yes.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|