Subject: | |
From: | |
Reply To: | |
Date: | Fri, 28 Dec 2001 18:52:31 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Stan writes:
> You could say that there's no such thing as "C library functions".
> There *are* libraries of functions that are available on various releases
> of Unix (and, indeed, most are intended to be called from C) ...
> but that doesn't give them the same air of respectability that the phrase
> "C library function" would seem to bestow.
I believe that several standards including ANSI C define a library of
functions, so in the case of ANSI C there *is* a very specific set of things
one can call the "Standard C Library", it's just that while atoi() *is* in
that standard, itoa() is *not* (I suppose you're intended to use sprintf()).
C has the irritating property of assuming that any function you reference
but do not define exists as (IIRC) a function taking int parameters and
returning an int functional result. This means you can get away with
thinking that if there's an atoi() then there must be an itoa() and sure
enough it works on a lot of systems where people have implemented itoa()
since it seemed like a logical thing to do.
When writing code that's intended to be portable or even just forwards
compatible, accidental successes can be at least as bad as accidental
failures.
G.
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|