   main class connected to two classes which have the same super class in C++
  I have a bullets class and a enemies class which both are sprite objects and they also have their own specific methods. Eg bullets have damage property and enemies have a health property. C++ doesn't like me including these two classes as they both are sprite object. It thinks that enemy class redefines the sprite class. So what should I do?I included the definition of tboth classes into my main class otherwise they wont recognise the classes.#include "bullet.cc"#include "enemy.cc"   
  Does  this article answer your question?   ;  It is possible that you are encountering the dreaded diamond inheritance problem. Here might be the answers to your questions.Hope that helps,Dave   ;  posting code or the compiler error would probably help out solving your problem.   ;  sorry I thought it was a simple one answer problem.http://www.geocities.com/steven11_ukuk/That url will give u all the code/ error messages   ;  Why are you using .cc's instead of regular .h and .cpp files?I would guess that your problem stems from multiple files including your sprite file, so it gets defined multiple times, which can be solved by using #ifndef #defineinclude guards, or on win32 by putting "#pragma once" at the beginning of a file.   ;  that was my guess too because it works if i dont include either bullet or enemy. Thanks. Whats wrong with cc fles they are for C++ source which is what I put in them   ;  The standard extensions for C++ files are '.h' fo header and '.cpp' for source files. You should use these whenever possible.As for your problem, the other posters above me have mentioned everything I guess. Don't ever include source files (you need to link them instead - for eg. by adding them to your project if you're using an IDE), just their headers, and don't forget to use include guards in the header files.   ;Quote:Original post by MorrandirThe standard extensions for C++ files are '.h' fo header and '.cpp' for source files. You should use these whenever possible.As for your problem, the other posters above me have mentioned everything I guess. Don't ever include source files (you need to link them instead - for eg. by adding them to your project if you're using an IDE), just their headers, and don't forget to use include guards in the header files.The C++ standard makes no mention of .cpp and .h (except for when talking about C header files), and the standard library's headers are extension-less. Many C++ gurus even use .hpp instead of .h (.h is for C header files, you shouldn't also use it for C++ headers). .cpp is pretty standard on Windows, on some platforms .cc is the standard for C++ source files.   ;  You're right, I didn't mean 'standard' as 'part of the C++ standard', a much better word would've been 'commonly used'.I guess it's rather pointless to argue about these things anyway, it's just the question of personal preference...Strange that I haven't heard about '.cc' for C++ source files before, although I have programmed on different platforms before...   