Thread: questions about classes(implementation files)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    42

    questions about classes(implementation files)

    Hi. I got a couple questions about implementation files. My book that I'm going through says to put the class in a header file, and the application and the class implementation into .cpp files(or whatever the system uses). No problem there. However, its telling me that you can compile the application file and the implementation file separately, and that the implementation file needs to be compiled only once.
    Is this some old feature of C++, or do i just need to find a way to let my compiler do it? I can't compile the implementation file because there is no main() in it. Of course, linking and then compiling the application file makes it all work. I checked my compiler options for something abou this.

    Second problem:

    In the book I have an exercise where I'm using two different classes.
    In the implementation files for both classes, I had a helping function called digit_to_int(char c). My book says these helping functions are local to the implementation files, so I could have the same function in my application file and implementation file and the compiler would regard them as different. However, my compiler complains, and I had to change one of the function names. Is this an old feature of c++ as well or something? If I had losts of classes, it would kind of suck if I had to make sure all my helping functions have different names. What should I do? Make them private member functions? Use #ifndef, ect?


    Not very important questions, but I would like to figure this out. The book is pretty old and my compiler is Dev-C++.

    Thanks.
    Last edited by Link_26; 06-21-2006 at 07:59 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C interview questions
    By natrajdreams in forum C Programming
    Replies: 7
    Last Post: 12-12-2010, 12:40 PM
  2. Program Deployment and DLL/OCX Files?
    By dfghjk in forum C++ Programming
    Replies: 5
    Last Post: 06-16-2008, 02:47 AM
  3. accessing all files in a folder.
    By pastitprogram in forum C++ Programming
    Replies: 15
    Last Post: 04-30-2008, 10:56 AM
  4. Help with loading files into rich text box
    By blueparukia in forum C# Programming
    Replies: 3
    Last Post: 10-19-2007, 12:59 AM
  5. Dos commands hehe
    By Carp in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 01-17-2003, 02:51 PM