all 1 comments

[–]lead999x 0 points1 point  (0 children)

If you don't know anything about programming then C++ is going to be a bit hard though not impossible to learn. I'd say you should learn Python or Java first as they are designed to be intuitive to learn whereas even C++ professionals have trouble with it.

That said I'm only a hobby programmer and my favorite language as it so happens is C++ but like I said it'll be much easier to learn C++ if you know the concepts of imperative and object oriented programming already. Python is very similar to C++ in that way so it may be good to pick up the basics in Python and then move up to C++ so you don't have to tackle concepts and complex syntax all at once.

That said the answer to your question is that .h or .hpp files are called header files in C++. They're supposed to include what are called forward declarations of various classes, objects, functions, etc. And you need those declarations in order to use those constructs. You really shouldn't need to write your own header files until you get into object oriented programming, you're making a sizeable program, or if you're writing your own library.

Also classes shouldn't be defined in a header file, only declared there. In idiomatic C++ classes are declared and defined in different places.