How do I see how stdio, say,works?

I'm trying to find out what the stdio functions look like, so I opened the .h file and started reading. The only useful thing I found, though, was the function prototypes. The included .h's didn't help me in this quest.
So I ask:
Where are those functions? What is their content? Why aren't they contained on the header?
The function bodies are in a library and they depend on the implementation.
You should look for some open source standard library so you can read the sourcecode.
The headers contain only the declarations or they will cause linker errors ("The symbol was already defined...")
The only headers with the implementation are those use templates (eg: STL headers) as template functions can't be implemented in file separated from the declaration
So, where can I find the <post header here> library code? Can I find stdio/math/whatever code on my PC?
You can download a version of the glibc source from rpmfind.net if using GCC.
So the code does not exist on my machine?
I don't think you have the standard library source on your computer,
to check it out, try looking on your compiler directories.
Last edited on
Any leads? Like the file extension?
.c .C .cpp
They should be in C/C++ source files
Nah, don't bother. Compilers (specially proprietary compilers, but compilers in general) usually don't come with the source code for their libraries. Just follow the link jsmith gave you, but prepare to be overwhelmed.
Topic archived. No new replies allowed.