Source code of the standard library functions...

This is a discussion on Source code of the standard library functions... within the C Programming forums, part of the General Programming Boards category; Hi, Is it possible to view the source code of the standard c library functions? Like viewing the source code ...

  1. #1
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020

    Source code of the standard library functions...

    Hi,

    Is it possible to view the source code of the standard c library functions? Like viewing the source code of printf() would be cool. IF so, how to do it?

    thnx

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    I don't know this, but I assume that the source code for your compiler is actually a mix of macros and assembly. Most of the stuff can be implemented in C, but it's just a need for speed kinda thing. Still, the source is out there... I think that DJGPP is open source.

    How printf works is something of a special case, since it uses a variable length argument list.

    Understanding how the functions work is something that I think K&R covers quite well. In fact, it has some interesting implementations at the end (fopen, getc, malloc, &ct).
    Callou collei we'll code the way
    Of prime numbers and pings!

  3. #3
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    Yes, you can view the source code of the standard C library functions. GCC is open source, the source code can be downloaded from gcc.gnu.org.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Seven Kingdoms I: Ancient Adversaries for Linux
    By MIH1406 in forum Projects and Job Recruitment
    Replies: 13
    Last Post: 01-17-2010, 05:03 PM
  2. exchange functions demo code
    By kryptkat in forum C++ Programming
    Replies: 0
    Last Post: 04-05-2009, 03:06 PM
  3. Search for patterns in source code
    By MiamiCuse in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 10-24-2005, 12:28 AM
  4. Links to learn standard C library functions...
    By Nutshell in forum C Programming
    Replies: 8
    Last Post: 02-01-2002, 12:41 AM
  5. C source code for int25 or code help
    By Unregistered in forum C Programming
    Replies: 0
    Last Post: 09-26-2001, 03:04 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21