HP3000-L Archives

December 2001, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Gavin Scott <[log in to unmask]>
Reply To:
Gavin Scott <[log in to unmask]>
Date:
Fri, 28 Dec 2001 18:52:31 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (28 lines)
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 *

ATOM RSS1 RSS2