I am having some trouble with the layout of my project. I'm using several APIs, including the WinAPI and DevIL. I had hoped to encapsulate each one in a separate header file, so that the main program would never have to know whats going on. The problem is, some functions have to refer to each other in different files. Is there any way I can let them do this and still keep the encapsulation?
death_oclock 103 Posting Whiz
Recommended Answers
Jump to PostJust put all the function definitions in one header file and have all the other headers include it. That way every function knows about every other function.
That's the worst solution. Now you have a huge scrap heap of all possible interfaces. It's hard to maintain such a heap, you …
Jump to PostI didn't quite understand that. I get the idea of using a common header for system includes. But the rest I wasn't sure of. Am I right in thinking this: include all formal function declarations first, then all their definitions?
I don't understand what's "formal function declaration". Have you ever …
Jump to PostWell, and what's your problem now? Only inline and template function definitions are placed in .h files.
Look at http://www.daniweb.com/forums/thread165526.html. May be it helps...
All 11 Replies
death_oclock 103 Posting Whiz
BestJewSinceJC 700 Posting Maven
death_oclock 103 Posting Whiz
death_oclock 103 Posting Whiz
ArkM 1,090 Postaholic
death_oclock 103 Posting Whiz
death_oclock 103 Posting Whiz
ArkM 1,090 Postaholic
death_oclock 103 Posting Whiz
ArkM 1,090 Postaholic
death_oclock 103 Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.