hpp and cpp

i m reading about the classes and writing example codes to understand. the book im following now came to a point that it first declares the class in *.hpp and then implements in *.cpp. i use dev c++.
i open a new project and write the codes that should be *.hpp in the empty page and i see that on the left a class system occure according to what i write. then i ve to write *.cpp part. but i dont know on what page to write it. anyone could simply help me?
hpp ... was a brief thing. I havent seen it in many years, it was to distinguish C headers "*.h" and c++ headers *.hpp. Just like the sources were .C and .CPP. This never really caught on, and everyone uses .h now.

All these are just text files. Some compilers will just work no matter what the extension of the file is, while others take it under consideration. We used to have to force-fit inline code with #include "something.inc" in the middle of code, just another text file extension from back when compilers were more stupid about performance and computers less potent.

Anyway, all that aside, the files are just plain text files with extensions that are language specific. You need the "definitions" in the H file (class foo {method(stuff); prototypes, etc} in the header and bodies (foo::method(stuff){code} in the .cpp file. There are additional considerations for template classes and some special cases; this is a starting point for simple classes.




Last edited on
> hpp ... was a brief thing. I havent seen it in many years, ... This never really caught on

I see headers with a .hpp extension literally every day; and have been seeing them every day for more years than I care to remember. It is very hard (impossible) to be a programmer who uses C++ in real life programs and live as if boost does not exist.
i use dev c++

please don't, it's horribly out-of-date
for more up-to-date ide's see here: http://www.cplusplus.com/forum/beginner/210594/
Topic archived. No new replies allowed.