including files

Discussion in 'C++' started by Blair Fonville, Dec 13, 2005.

  1. 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

    ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
     
    Blair Fonville, Dec 13, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MS News \(MS ILM\)
    Replies:
    1
    Views:
    429
    Scott Schluer
    Aug 19, 2003
  2. Xavier MT
    Replies:
    1
    Views:
    613
    Scott Schluer
    Aug 19, 2003
  3. farmer

    "Including" multiple files?

    farmer, Aug 2, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    624
    farmer
    Aug 2, 2005
  4. Raman
    Replies:
    5
    Views:
    384
    Lew Pitcher
    Jun 7, 2008
  5. Nathan Beyer
    Replies:
    0
    Views:
    124
    Nathan Beyer
    Nov 15, 2009
Loading...

Share This Page