Very new to c++! One of those kids who did Java for years and left scratching his head over the extra complexities that c++ brings.
I'm getting the hang of it, but something confuses me..
My understanding of header files is that you define a method to be used in the .cpp file. Why am I coming across examples that (for example) actually fill out the method body?
Hiya, and welcome to hell. We have ginger snaps of unreal quality. :D
Sometimes it makes sense to have an inline function for performance reasons, especially if the functions are short. Compilation times will drop somewhat because of inline functions, and in cases of whole classes being defined inline, this can really bloat up files. It's generally a good practice not to do it.
Ah ok, thanks! So this way of defining is almost exclusively for inline methods? If so, that first example I gave (which isn't inline), why does/can that still have a method body of 'return type;'?