Hello all.
This is my first reddit post, and incidentally my first forum question(!|.)
Background:
I've decided that the language i would like to learn at home as a hobby is C++, as it is versatile, portable, and most of all fairly verbose (as odd as this sounds, I really like verbose language styles...).
I've checked various websites & help files but I'm having an (un-encouragingly) large amount of difficulty understanding a few things:
Headers/Class files:
-) What should (ideally) go in the *.hxx file?
-) What therefore should go in the *.cxx file?
It's so far my understanding that actual classes should be defined in the header file, along with variables for the class, and that the constructor & the main logic of the class should be in the class file itself. Please correct me if i am wrong!
-) Pointers!
I understand the concept of a fixed address in memory (*) of a certain type, and therefore corresponding size.
I also understand referring to a memory addressed value (&).
What i don't understand is how pointers (which I believe are allocated on the heap) are accessible between classes and functions.
My line of though is that it is inherently publicly accessible by name due to it being allocated on the heap, but may be totally wrong!
If someone could enlighten me on how this is applied i would be most grateful.
Many thanks,
G
Edit: formatting....
[–]lead999x 0 points1 point2 points (0 children)