开发者

Where to find the implementation of stdio.h? [duplicate]

开发者 https://www.devze.com 2023-03-10 03:13 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Where to find stdio.h functions implementations ?
This question already has answers here: Closed 11 years ago.

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 ther开发者_开发百科e 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消