LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-22-2005, 03:15 AM   #1
cigarstub
Member
 
Registered: Sep 2005
Posts: 145

Rep: Reputation: 15
stdio.c


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
 
Old 10-22-2005, 03:30 AM   #2
ichrispa
Member
 
Registered: Mar 2005
Location: Dresden, Germany
Distribution: OpenSuse 11.2/3, Debian 5.0 , Debian 1.3.1, OpenBSD
Posts: 277

Rep: Reputation: 32
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
 
1 members found this post helpful.
Old 10-27-2005, 09:00 AM   #3
naf
Member
 
Registered: Oct 2005
Location: Chicago, USA
Distribution: Slackware & Fedora
Posts: 66

Rep: Reputation: 15
Run the preprocessor like:
Code:
gcc -E source.c > for_printing.txt
The preprocessor will remove comments.

Additionally, you can use awk to remove blank lines.
Moreover, you can use tail to every line after the 20th line.
 
Old 12-17-2014, 12:36 PM   #4
Cagebreinne01
LQ Newbie
 
Registered: Dec 2014
Location: PK
Posts: 9

Rep: Reputation: Disabled
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 ?
 
Old 12-17-2014, 10:23 PM   #5
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
In source file just add this line:

#include <stdio.h>

That's all.
 
Old 12-17-2014, 10:28 PM   #6
Cagebreinne01
LQ Newbie
 
Registered: Dec 2014
Location: PK
Posts: 9

Rep: Reputation: Disabled
Okay. I'll make try
 
Old 12-17-2014, 10:49 PM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by Cagebreinne01 View Post
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.

Evo2.
 
Old 12-18-2014, 03:30 AM   #8
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
The source of glibc is available for downloading, but it is not required for using glibc.
 
Old 12-18-2014, 10:18 AM   #9
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
It's also available online and cross-referenced.
 
Old 12-18-2014, 10:25 AM   #10
Cagebreinne01
LQ Newbie
 
Registered: Dec 2014
Location: PK
Posts: 9

Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
It's also available online and cross-referenced.
Greatest site you posted here... Thanks allot for this site. Really found this helpful to me.
 
Old 12-18-2014, 11:30 AM   #11
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,222

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
P. J. Plauger's book, The C Standard Library, has source code implementing everything in the standard library. I keep meaning to buy it.
 
Old 12-18-2014, 12:33 PM   #12
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by Cagebreinne01 View Post
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.
 
Old 12-19-2014, 06:39 AM   #13
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939
Agreed. But, "it's done now."

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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What package is stdio.h in? halfpower Linux - Newbie 4 08-25-2005 10:57 AM
gcc and stdio in 9.1 iansworld SUSE / openSUSE 1 10-19-2004 01:35 PM
#include <stdio.h>? blackzone Programming 2 09-30-2004 06:00 AM
iostream, or stdio? jpc82 Programming 7 11-05-2003 08:10 PM
input from stdio raven Programming 2 05-12-2002 10:52 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration