Thread: printf() function definition

  1. #1
    Registered User
    Join Date
    Apr 2008
    Location
    New Delhi,India
    Posts
    17

    printf() function definition

    In which header file exactly printf() function is defined??

    stdlib.h/libc.so

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    stdio.h
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Actually, the DEFINITION of printf() is not in any header file. There is a declaration (so that the compiler knows what the function looks like with respect to what arguments it takes), but the definition (describing to the compiler what the function does) is part of the C runtime library. In the glibc case, that would be printf.c.

    As you can see from that, most of the work is done in vfprintf.c

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  3. Double to Int conversion warning
    By wiznant in forum C Programming
    Replies: 15
    Last Post: 09-19-2005, 09:25 PM
  4. Drawing tables in C
    By stanoman in forum C Programming
    Replies: 5
    Last Post: 10-09-2003, 10:14 AM
  5. function problems
    By money in forum C++ Programming
    Replies: 5
    Last Post: 07-16-2003, 11:40 AM