This may seem like a basic question.
I am reading c++ without fear and I am near the end. He switches from writing all programs in one file to using include directives.
While I understand how they work, I am confused about how to create a header file and include it.
I am working on inheritance and I need to put a Fraction class in a header file, and then include it in a new file for a subclass.
The explanation in the book is not much more than, type #include "file.h"
I am using codeblocks if that helps. I used there wizard to create a header file named fraction.h, I saved that in the same folder where the file I am working on is save as .cpp.
Using #include "Fraction.h" and trying to compile and run leads to an error of :No such file or directory.
Other than this hang up the book is a smooth learning experience. I am wondering if I should learn to manually compile and remove the IDE to get a better feel for how everything works.



LinkBack URL
About LinkBacks



perator<< [with _Traits = std::char_traits<char>](((std::basic_ostream<char, std::char_traits<char> >&)(& std::cout)), ((const char*)"Value of ")) << fract1'| 