Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 935125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:06:31+00:00 2026-05-15T21:06:31+00:00

I’m quite new to programming larger applications. I have now written a command line

  • 0

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!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:06:32+00:00Added an answer on May 15, 2026 at 9:06 pm

    IMO, there is no need to be “C” compliant in 2010. Just use C++ and all its advantages (STL, boost, all that jazz… )

    AFAIK, putting the code in header files is not normal practice, usually code goes in implementation files ( .c, .cpp, … ).

    Putting code in C/CPP files ( instead of header files) will let you optimize compile time dependencies (forward declarations, PIMPL, … ) and limit the visibility of non-public data that you do not want “users” of some piece of code to see.

    Using standard libraries will help the stability, readability and maintenance of code in the long run by reducing the potential bugs that can/will happen when dealing the complex structures and algorithms (for example, it’s easier to deal with std::vector than arrays and std::string than char*)

    M.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.