Possible Duplicate:
Where to find stdio.h functions implementations ?
Hi, I am trying to find the function definitions of the functions defined in stdio.h header file, I want to learn how functions like printf() is achieved, but I can't find any preprocessor directives link in stdio.h to the implementation file elsewhere. How can a C Compiler know where to find the implementations when there are no direct references to the function definition file? (I learned that .h file may accompany with a same name .c implementation file from an objective-c book.) Could you help me? Thanks! I am using GCC on Mac OS X.
In Ubuntu, which your original question indicated you're using, the “root” stdio. h file is in /usr/include .
#include<stdio. h> means, during compilation preprocessor will search the stdio header file only in predefined path(/user/include/). whereas #include"stdio. h" preprocessor first search in present working directory, if stdio header file is not present there, it will search in the predefined path.
The File Stdio. h is included in the path C:\Program Files (x86)\Windows Kits\10\Include\10.0. 17134.0\ucrt.
FreeBSD
's libc is pretty well laid out in its src repository.
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/
e.g. for printf(3)
:
http://svnweb.freebsd.org/base/head/lib/libc/stdio/printf.c?view=markup
http://svnweb.freebsd.org/base/head/lib/libc/stdio/vfprintf.c?view=markup
Try downloading source code for GLIBC library project. That's where definitions for standard functions are when using GCC compiler (and derivates).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With