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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:42:41+00:00 2026-06-16T01:42:41+00:00

i know what is a header file,but,i still don’t understand why a lot of

  • 0

i know what is a header file,but,i still don’t understand why a lot of programmers make a header file,and a source file with the same name,and only prototype functions in the header file,while tell what the function does in the source file.

I never make functions and their prototypes in separate files,just stuff it all into the header file.

The question is,why make a source file for headers?Does it give any advantages?Is it just to make the code look cleaner?I don’t understand.

  • 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-06-16T01:42:44+00:00Added an answer on June 16, 2026 at 1:42 am

    If you implement a function in a header, and then include the header into two or more different source files, you’ll have multiple definitions of the same function. This violates the one definition rule.

    It’s possible to get around that by declaring the functions inline, but (unless the linker knows how to merge the multiple definitions) that can lead to code bloat.

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

Sidebar

Related Questions

Sorry for posting such a lowly beginner's question, but I just still don't know
I hope to display the download file size by reading http header. I know
I know I could solve this with a header but I'd rather not have
I don’t know why but no Ajax is happening. It just links me to
I know this question would have been asked several time but still I am
I know how to redirect a page using the header thing. The problem is
I want to know column index of header in AdvancedDataGrid when a user clicks
I know I'm being lazy here and I should trawl the header files for
I know in the Manuel it says that the header has to be the
As i know the boolean size in 16 bytes {8 as header,1 payload ,*

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.