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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:28:05+00:00 2026-06-18T03:28:05+00:00

The library header files contain only the declarations of functions. So, how exactly does

  • 0

The library header files contain only the declarations of functions. So, how exactly does the function run when we call the library functions?

Ex: int strcmp ( const char * str1, const char * str2 ); is the declaration for strcmp function in C.

When we call strcmp function in a program, how exactly does the strcmp function get executed if the function body is not present in the header files?

  • 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-18T03:28:06+00:00Added an answer on June 18, 2026 at 3:28 am

    The code that you want to use like printf is already compiled and stored somewhere. Your final executable is built when the linker links your object code with the standard library.

    try gcc -c somefile.c and see what you get.

    Also try gcc -v option and learn the output that it gives.

    Find out what ld command does and you shall get your answer.

    Also this what I think should help you : All about compilation/linking/related

    UPDATE :

    Also Imagine if you defined printf for every program in stdio.h and you included stdio.h

    program.c :

    #include <stdio.h>  //suppose this contains definition of printf     
    
    int main()
    {            
    
    /*Call printf()  somewhere or maybe not */
    
    }
    

    gcc program.c -o output

    So here all your definitions that are there in stdio.h would be replaced in the program.c file and your executable output will become pretty HUGE. Instead It would be a better idea to call functions that you use frequently like printf in stdio.h from one place whenever they are needed

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

Sidebar

Related Questions

I'm working on a shared library that has some header files which contain function
I am developing a library that will consist of header files only. So far,
I have the following function defined in a header file (the library it is
When writing a header library (like Boost ), can one define free-floating (non-method) functions
Assume that there's no problem with my header file and some included library. I'm
I want to use an 3rd party library without using its header file. My
I want to reimplement a library of which I have the header file. I
I need a code example or library which would parse Accept-Language header and return
I'm using require_once() in header.php to include the FirePHP library. In the page.php I'm
I'm trying to write a framework library which wraps MPI. I have a header

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.