I have simple question.
I have long code in my .cpp file with classes functions etc.
I would like to divide it into separate cpp and .h files. What are rules governing the stuffing? Any good tutorial/example?
Cheers :)
Stefano Mtangoo
455
Senior Poster
Recommended Answers
Jump to PostFind your answer by Searching the web: here is a pointer to a good thread which is very near to yours http://groups.google.com/group/comp.lang.c++/browse_thread/thread/1a4b427d09b3eb77
Jump to Postclass MyApp ... goes in MyApp.h
Along with any necessary includes to make MyApp.h a standalone include (that is, anyone who includes it doesn't have to go fishing to find pre-requisite includes)bool MyApp::OnInit ... goes in MyApp.cpp
This includes MyApp.hDitto for the others.
In your …
All 5 Replies
siddhant3s
1,429
Practically a Posting Shark
Stefano Mtangoo
455
Senior Poster
Stefano Mtangoo
455
Senior Poster
Salem
5,138
Posting Sage
Stinomus
11
Junior Poster
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.