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 6334285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:37:50+00:00 2026-05-24T18:37:50+00:00

Possible Duplicate: In C++ why have header files and cpp files? I was wondering

  • 0

Possible Duplicate:
In C++ why have header files and cpp files?

I was wondering if it is advisable to write a the whole class c++ in a header file ? and use include to include the class, in a similar way that java does its oop programming. Is it a bad style ? can anyone recommend me a “good” C++ oop style guide ? Also I wondering if template programming is what they really mean when they talk about someone who is experienced in c++.

  • 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-24T18:37:51+00:00Added an answer on May 24, 2026 at 6:37 pm

    Including function definitions in a header file has some knock on effects and it’s generally avoided. Functions defined in this manner are likely to be inlined, which will increase the size of your executable which can effect performance (in a positive or a negative way). Also, doing this can increase your build times, as having all definitions in line will increase the likelihood that you have to include additional files, etc.

    The general practice is to put a classes interface in a header file (.h) and its implementation in a implementation file (.cpp).

    In some cases it’s required to have all of the code available — as is the case with templates. The STL makes extensive use of templates and implementations of functions are included in the header files by necessity.

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

Sidebar

Related Questions

Possible Duplicates: [C] Header per source file. In C++ why have header files and
Possible Duplicate: Regex for matching javadoc fragments I have files having content like /**
Possible Duplicate: Escape string for use in Javascript regex I have a msg like
Possible Duplicate: Do I have to use mysql_real_escape_string if I bind parameters? I have
Possible Duplicate: When do we have to use copy constructors? Why exactly are C++
Possible Duplicate: Why can templates only be implemented in the header file? Why should
Possible Duplicate: Displaying the #include hierarchy for a C++ file in Visual Studio I
Possible Duplicate: Way to have compiled python files in a separate folder? When python
Possible Duplicate: Declaring a function that return a 2D array in a header file?
Possible Duplicate: .NET & Tab-Delimited files I have a list that has 2 columns:

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.