PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > C lib functions
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
C lib functions

Réponse
 
LinkBack Outils de la discussion
Vieux 29/05/2008, 23h37   #1
Xia
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut C lib functions

Is there a way(or where) I can see a certain C lib function, for
example atoi, is implemented? Thanks in advance.
Xia
  Réponse avec citation
Vieux 29/05/2008, 23h45   #2
vippstar@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C lib functions

On May 30, 1:37 am, Xia <ningx...@gmail.com> wrote:
> Is there a way(or where) I can see a certain C lib function, for
> example atoi, is implemented? Thanks in advance.
> Xia

If your implementation is open-source, you can.
(such as glibc; <http://www.gnu.org/software/libc/libc.html>)
There's also an excellent book by P.J. Plauger, "The Standard C
Library", which has a complete implementation of a standard C library.
K&R2 has an implementation of atoi in 2.7
  Réponse avec citation
Vieux 29/05/2008, 23h52   #3
dj3vande@csclub.uwaterloo.ca.invalid
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C lib functions

In article <9f6d4611-b2a2-4184-a8da-681582f469e2@k30g2000hse.googlegroups.com>,
Xia <ningx005@gmail.com> wrote:
>Is there a way(or where) I can see a certain C lib function, for
>example atoi, is implemented? Thanks in advance.


There are several open source implementations of the standard C library
that you can look at. (See
<http://c-faq.com/resources/stdlibsrc.html>.)

Be warned that most of them do several of:
-Implement functions beyond the ones specified by the C standard
-Call non-standard functions to do some or all of the work
(for several standard library functions this is unavoidable)
-Use non-portable compiler extensions
-Use horribly ugly efficiency hacks
These are things that make sense for library implementors to do rather
more often than they make sense for user-programmers to do, so if your
intention is to learn how to write good code, you may be better off
looking at code other than implementations of the standard library.

Note also that the language defines the interface to and behavior of
the standard library functions, not the implementation. As long as it
meets the requirements imposed on it by the specification, the way your
implementation's standard library works may be entirely different from
the one you're looking at.


dave

--
Dave Vandervies dj3vande at eskimo dot com
I think it's obvious that pretty != fit for purpose. Except that, I suppose,
in this case pretty *is* the purpose, and rideability is relatively
unimportant. --Eric Schwartz in the scary devil monastery
  Réponse avec citation
Vieux 30/05/2008, 00h06   #4
Pietro Cerutti
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C lib functions

Xia wrote:
> Is there a way(or where) I can see a certain C lib function, for
> example atoi, is implemented? Thanks in advance.
> Xia


you mean "how" it is implemented or "whether on your system" is implemented?

Sorry, can't understand your question.

--
Pietro Cerutti
  Réponse avec citation
Vieux 30/05/2008, 00h17   #5
user923005
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C lib functions

On May 29, 3:37pm, Xia <ningx...@gmail.com> wrote:
> Is there a way(or where) I can see a certain C lib function, for
> example atoi, is implemented? Thanks in advance.


It's a FAQ:
18.13: Where can I find the sources of the standard C libraries?

A: The GNU project has a complete implementation at
http://www.gnu.org/software/libc/. Another source (though not
public domain) is _The Standard C Library_, by P.J. Plauger
(see
the Bibliography). See also questions 18.9b, 18.15c, and
18.16.

Also, the Microsoft compiler comes with source for the library.
The Watcom C compiler has an open source library.

Often, C library functions are not written in C but (rather) in
assembly language.

  Réponse avec citation
Vieux 31/05/2008, 12h20   #6
Rui Maciel
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C lib functions

On Thu, 29 May 2008 15:37:31 -0700, Xia wrote:

> Is there a way(or where) I can see a certain C lib function, for example
> atoi, is implemented? Thanks in advance. Xia


If you want to see how a particular standard library function is
implemented then, as it has already been stated before, you only need to
get your hands on any open source standard library and just dig in.

If, on the other hand, you need to check if a certain function is
available on your system then you can always adopt the ./configure script
approach, which is to try to compile some minimalist test code that uses
that particular function and check if the compilation fails or not.


Hope this s
Rui Maciel
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h49.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,14262 seconds with 14 queries