I'm quite new to programming "larger" applications. I have now written a command line application with a few thousand lines of code in Visual C++ 2010, which compiles and works fine. Most of the code is C-compliant (I think), however, I found it useful to use some C++ constructs here and there. E.g., sometimes I used new/delete instead of malloc/free to invoke the constructor or used a std::vector or std::set for convenience. I put all my code in around 25 .h files, except for int main(), which is currently in a .cpp file.
My specific questions are:
I'm guessing all of my code is compiled as C++ code. Does it make sense to make some parts of the code truly C-compliant? Could I have Visual Studio compile it as C then? For large parts of the program it would be quite simple to make them C-compliant (e.g., replace new with malloc and initializer function, etc.) for some parts more hard (convert a std::vector). Or would it only make sense if everything was C? What would be the advantages? Alternatively, would it make sense to convert everything to C++? E.g., use new instead of malloc and std::string instead of char*.
I'm guessing it is not intended to have all code in .h files. How should I put my code into files? Except for a few, I do not have very large classes. Most of my code is procedures and functions.
My two main concerns are efficiency and a decent standard of programming. Portability is not a concern right now.
Thank you very much!!