By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,192 Members | 855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,192 IT Pros & Developers. It's quick & easy.

including files

P: n/a

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.


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Dec 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.