Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: C library and C implement

Reply
Thread Tools

Re: C library and C implement

 
 
Eric Sosman
Guest
Posts: n/a
 
      01-01-2014
On 1/1/2014 9:31 AM, gyl wrote:
> I am not cleared with the concept of "language library" and "language
> implement".
> Here are my questions:
> 1. what is a C library used for?


To accomplish things that can't be done in unaided C itself,
or things that would be tedious and expensive if you had to re-
implement them for every program that needed them. For an example
of the first, consider the exit() function: The incantations that
shut down programs in Windows, Unix, i5/OS, OpenVMS, ... are all
different, and can't be done given only `for' and `switch' and so
on. For an example of the latter, consider the atan2() function:
It is more convenient (and less costly, and less error-prone) to
use the pre-written and pre-tested atan2() function from the library
than to write your own arctangent every time you need one.

> 2. Is it true that a C implement contains a C library?


Every hosted C implementation provides the library functions
(and macros and so on) specified by the Standard. Many provide
additional libraries for things like graphics or networking or
other areas not addressed by the Standard.

A "freestanding" C implementation need not provide all of the
Standard library; indeed, it might provide none at all.

> 3. What is POSIX? is it a library standard?


There's lots of information at <http://lmgtfy.com/?q=POSIX>.

> 4. What is the difference between glibc and MSVC's c runtime library?


What is the difference between a Ford and a Jeep? Both are
automobiles, but built by different companies and with different
purposes and audiences in mind.

> 5. How can I do some real programming with a C library?


Write C, and you'll find yourself using the Standard library
as soon as you call printf() -- or exit(), or sqrt(), or malloc(),
or ...

Using other libraries -- whether provided by third parties or
composed of your own components -- depends a lot on the environment:
Different tool sets have different ways of saying "Put this into my
program, please." In most C environments, your source code will use
the #include directive to obtain the compile-time declarations and
stuff that the library components need, and at "link time" you will
indicate where the pre-compiled library can be found. Variations
abound.

--
Eric Sosman
http://www.velocityreviews.com/forums/(E-Mail Removed)d
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: C library and C implement osmium C Programming 1 01-01-2014 11:19 PM
Ruby gem, library, class to implement typical functionality of a utility like cp? Randy Kramer Ruby 4 10-15-2007 02:28 PM
How to implement arctan(x) without using standard library? Gerald C++ 5 12-09-2005 12:44 PM
How to implement arctan(x) without using standard library? Gerald C++ 0 12-09-2005 08:56 AM
Re: Difference between Web Control Library and Class Library Mythran ASP .Net 0 08-24-2004 05:53 PM



Advertisments