Article View: comp.std.c
Article #3706Re: gets() and getchar
From: Lars Wirzenius
Date: Fri, 11 Aug 1995 13:55
Date: Fri, 11 Aug 1995 13:55
26 lines
1733 bytes
1733 bytes
wirzeniu@cc.Helsinki.FI (Lars Wirzenius): > One thing I would like to see (if we're going to have a new standard > anyway, that is) is something that does what strncpy should have done. Actually, to followup to my own post (darn those quick save-and-post fingers), there're a few other mem*/str* functions that might also be useful to have in the standard: memrchr - counterpart to memchr strend - convenience function for strchr(s, '\0') strmove - similar to memmove strnlen - like strlen, but give a maximum strdup is _quite_ common, and should be available in some way. (After that, strndup is nice.) Some standard comparison functions for qsort and bsearch would be nice. After that, implementing these so that they aren't slower than versions written for some specific type is trivial. (At least comparisons for all the basic integer and floating point types and strings are needed.) (Publib has these, and a few dozen others. Blatant advertising, what?) -- Lars.Wirzenius@helsinki.fi (finger wirzeniu@klaava.helsinki.fi) Publib version 0.5: ftp://ftp.cs.helsinki.fi/pub/Software/Local/Publib/
Technical Details
Message-ID:
<40fng8$7ep@kruuna.helsinki.fi>Path:
arc1-ca.pugleaf.net!news.helsinki.fi!not-for-mailReferences:
<Pine.ULT.3.91.950807194041.19202A-100000@mars> <40bqih$bft@caip.rutgers.edu> <1995Aug11.002333.20047@dcs.warwick.ac.uk> <40fn05$686@kruuna.helsinki.fi>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.helsinki.fi!not-for-mail From: wirzeniu@cc.Helsinki.FI (Lars Wirzenius) Newsgroups: comp.std.c Subject: Re: gets() and getchar Date: 11 Aug 1995 16:55:20 +0300 Organization: University of Helsinki Sender: wirzeniu@cc.helsinki.fi Message-ID: <40fng8$7ep@kruuna.helsinki.fi> References: <Pine.ULT.3.91.950807194041.19202A-100000@mars> <40bqih$bft@caip.rutgers.edu> <1995Aug11.002333.20047@dcs.warwick.ac.uk> <40fn05$686@kruuna.helsinki.fi> NNTP-Posting-Host: kruuna.helsinki.fi Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit