#Classes
4 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
You separate declarations and definitions. A declaration might be void invest(Stock stock); and a definition might be void invest(Stock stock) { stock.invest(); }. You put the declaration in a .h file and the definition in a .cpp file. Then in the other file you #include "header.h" which makes the declarations available and lets you call them. Then you need to tell your build system to compile and link all the .cpp files and it will produce an executable.
You can put your stockInvestor class in it's own header file so it can be #included in both files. You can also forward declare the stockInvestor class in the missing file if the inclusion order allows for it.