Newbie C language Header and Include files question

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

Newbie C language Header and Include files question

Postby TonyBradley » Sat Sep 24, 2011 1:02 pm

I'm totally new to this programming lark...

C has many functions to perform specific tasks, stored in library files.

Why does it use so many different library files? Surely it would make more sense to store them all in one file, negating the need to remember which header and include files to place in your code!

Is there a way to learn which files store which functions, and where they are stored?
TonyBradley
 
Posts: 22
Joined: Thu Jul 13, 2006 1:40 pm
Location: Plymouth

Postby larcky » Sat Sep 24, 2011 5:29 pm

Hi
Surely it would make more sense to store them all in one file

No because then that file would be HUUUUUUUUUUUUUGE!!! and impossible to maintain.
You'll soon get used to it.

Is there a way to learn which files store which functions, and where they are stored?

You can always just browse through the headers themselves (in /usr/include) to see what they're up to. Or if you know what a function's called but don't know where it is, there's an excellent reference section at http://cplusplus.com.
If you're after a good reference book have a look here:
http://www.amazon.co.uk/Reference-Manual-Samuel-P-Harbison/dp/013089592X/ref=sr_1_14?ie=UTF8&qid=1316884734&sr=8-14
larcky
 
Posts: 19
Joined: Sun Nov 21, 2010 6:28 pm
Location: England


Return to Programming

Who is online

Users browsing this forum: Bing [Bot] and 0 guests