ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
so Complex this file ! I don't understand why people put " This ... GPL copyright...Without any warranty of merchantability..) every where on 10.000 files of glibc. Each paragraph costs 20 lines of 70 letters . so its 1k. On 10.000files it's 10.000.000 bytes!!!!!!!!!!!!!!!!!!!!!!!!!
I can't print files to read bc of lack of toner due to uneccessary repeatedness
And exactly how am I to assist you? Post addresses of stores for cheap toner refills or edit 10.000 files by removing the (quote) "This ... GPL copyright...Without any warranty of merchantability..)"???
I mean, I would love to but I am slightly busy right now
May be it is wrong place to put my question, But I'm little confuse, & this place I really like to ask..
I study C and I notice I can`t find implementation file for some header files like stdio.h for example. stdio.h contain a lot of i/o functions like printf. Where to find it implementation ?
May be it is wrong place to put my question, But I'm little confuse, & this place I really like to ask..
I study C and I notice I can`t find implementation file for some header files like stdio.h for example. stdio.h contain a lot of i/o functions like printf. Where to find it implementation ?
The implementations are noramally in the .c files. You are unlikely to have these on your system since they are not needed either at run time or when compiling your own code against the libraries (in this case you just need the definitions in the header files and the binary libraries). To get the .c files you should download/install the full source. The easiest way to do this depends on what OS you are running.
May be it is wrong place to put my question, But I'm little confuse, & this place I really like to ask..
I study C and I notice I can`t find implementation file for some header files like stdio.h for example. stdio.h contain a lot of i/o functions like printf. Where to find it implementation ?
Not an incorrect place, the programming forum, to ask your question. In the future, please start a new thread and refrain from resurrecting 9 year old threads. The interface should've warned you that you were about to re-open a thread which had no activity for greater than 6 months.
To answer your direct question, and disregarding the irrelevant corpses: every C-program (like every program in [almost] every other programming language ...) relies upon a set of subroutines which it simply presumes will exist. And of course, they do exist ... but where?
The answer, in the case of programs written in "gcc," is the glibc standard library.
This will usually be a .so file, which means that it is loaded dynamically by Linux anytime any program requiring its services (which, in this case, is "everything") needs to run. That single copy of object-code is then shared by everyone who needs it. It is, as you may well have guessed, a very large and complex library, full of some "seriously voodoo" code.
Strictly speaking, that's not the only way to do it. The necessary subroutines can also be "statically linked" into the executable file, so that no external libraries are then necessary.
The entire process of creating a computer-program in "C" is at least a two-stage process: first, the C source-code is compiled; then, the outputs of the compiler are linked to create a complete executable. (Which may then, as aforementioned, require the services of one-or-more external libraries which will be required to be present every time this program is run.) Most production programs consist of hundreds of ["C" ...] source-files, not all of which must be re-compiled every time: you re-compile only what just got changed, then you link everything (old or new ...) together again. "Rinse and repeat."
stdio.h, among others, provides the compiler with the "header files" needed to know what the runtime routines "look like," so that it can generate appropriate calls to them.
Last edited by sundialsvcs; 12-19-2014 at 06:42 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.