B
Blair Fonville
Hi,
I have a basic c++ question to which I can't find an answer in my books.
Suppose I have a pair of files date.h/date.cpp which creates a class
"date". I then have a pair of files calculator.h/calculator.cpp which
creates a class "calculator". The calculator uses the date class (so I
have an #include "date.h" in my calculator.h file). From now on, in any
new programs which I may write, I would like to be able to use my
calculator class and have the date class be completely transparent. So
in my new program, I'll #include "calculator.h" and instantiate
calculator, but have no knowledge of the existance of date. How can I do
this? I always get compile errors (or are they link errors? I don't
recall) unless I add the date.h/date.cpp files to my project. I don't
want to have to add these files to my project each time, when I don't
need them - calculator does, but my program only needs them implicitly.
Thanks,
Blair
I have a basic c++ question to which I can't find an answer in my books.
Suppose I have a pair of files date.h/date.cpp which creates a class
"date". I then have a pair of files calculator.h/calculator.cpp which
creates a class "calculator". The calculator uses the date class (so I
have an #include "date.h" in my calculator.h file). From now on, in any
new programs which I may write, I would like to be able to use my
calculator class and have the date class be completely transparent. So
in my new program, I'll #include "calculator.h" and instantiate
calculator, but have no knowledge of the existance of date. How can I do
this? I always get compile errors (or are they link errors? I don't
recall) unless I add the date.h/date.cpp files to my project. I don't
want to have to add these files to my project each time, when I don't
need them - calculator does, but my program only needs them implicitly.
Thanks,
Blair