954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

just a quick question!

Hey, I’m trying to put a c++ project together using Dev-c++. Is there any reason why I can’t define 2 NEW different classes in different .h files in the same project?

sirkraven
Newbie Poster
16 posts since May 2006
Reputation Points: 10
Solved Threads: 0
 

>Is there any reason why I can’t define 2 NEW different classes in different .h files in the same project?
No. The only reason for not doing this is organization, if you have classes in their own separate source and header files, the code, and thus the project, tends to be easier to maintain.

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 

where do you recomend putting in the line

#include @@@@.h

in the project?

sirkraven
Newbie Poster
16 posts since May 2006
Reputation Points: 10
Solved Threads: 0
 

> where do you recomend putting in the line
At the top of every file that needs to use the functions/classes that are declared or defined in the header.

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 

:D
That’s what I’m doing, so there must be something else wrong with it!:'(


:)thanks anyway!

sirkraven
Newbie Poster
16 posts since May 2006
Reputation Points: 10
Solved Threads: 0
 

Post your code. And you are using header sentinals (#ifndef/#define/#endif) to prevent multiple header inclusions, aren't you?

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You