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