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
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
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!
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.