Please update your links, and thanks -
Certain topics come up again and again on this newsgroup. They are good questions, and the answers may not be immediately obvious, but each time they recur, much net bandwidth and reader time is wasted on repetitive responses, and on tedious corrections to the incorrect answers which are inevitably posted.
This article, which is posted monthly, attempts to answer these common questions definitively and succinctly, so that net discussion can move on to more constructive topics without continual regression to first principles.
No mere newsgroup article can substitute for thoughtful perusal of a full-length tutorial or language reference manual. Anyone interested enough in C to be following this newsgroup should also be interested enough to read and study one or more such manuals, preferably several times. Some C books and compiler manuals are unfortunately inadequate; a few even perpetuate some of the myths which this article attempts to refute. Several noteworthy books on C are listed in this article's bibliography. Many of the questions and answers are cross-referenced to these books, for further study by the interested and dedicated reader (but beware of ANSI vs. ISO C Standard section numbers; see question 5.1).
If you have a question about C which is not answered in this article, first try to answer it by checking a few of the referenced books, or by asking knowledgeable colleagues, before posing your question to the net at large. There are many people on the net who are happy to answer questions, but the volume of repetitive answers posted to one question, as well as the growing number of questions as the net attracts more readers, can become oppressive. If you have questions or comments prompted by this article, please reply by mail rather than following up -- this article is meant to decrease net traffic, not increase it.
Besides listing frequentlyasked questions, this article also summarizes frequentlyposted answers. Even if you know all the answers, it's worth skimming through this list once in a while, so that when you see one of its questions unwittingly posted, you won't have to waste time answering.
This article was last modified on August 1, 1995, and its travels may have taken it far from its original home on Usenet. It may now be outofdate, particularly if you are looking at a printed copy or one retrieved from a tertiary archive site or CDROM. You can always obtain the most uptodate copy by anonymous ftp from sites ftp.eskimo.com, rtfm.mit.edu, or ftp.uu.net (see questions 17.12 and 17.33), or by sending the email message "help" to email@example.com. This article was produced for free redistribution. You should not need to pay anyone for a copy of it.
Other versions of this document are also available.
Posted along with
it are an abridged version and (when there are changes) a list of
differences with respect to the previous version.
A few preliminary
hypertext versions are available on the worldwide web (WWW); see URL's
<http://www.lysator.liu.se/c/c-faq/index.html>. Finally, for those who might prefer a bound, hardcopy version (and even longer answers to even more questions!), a booklength version will be published by AddisonWesley in November, 1995 (ISBN 0-201-84519-9).
This article is always being improved. Your input is welcomed. Send your comments to firstname.lastname@example.org .
The questions answered here are divided into several categories:
P.J. Plauger, The Standard C Library, Prentice Hall, 1992, ISBN 0-13-131509-9.
Harry Rabinowitz and Chaim Schaap, Portable C, Prentice-Hall, 1990, ISBN 0-13-685967-4.
Thanks to Jamshid Afshar, Sudheer Apte, Randall Atkinson, Dan Bernstein, Vincent Broman, Stan Brown, Joe Buehler, Gordon Burditt, Burkhard Burow, Conor P. Cahill, D'Arcy J.M. Cain, Christopher Calabrese, Ian Cargill, Paul Carter, Billy Chambless, Raymond Chen, Jonathan Coxhead, Lee Crawford, Steve Dahmer, Andrew Daviel, James Davies, Jutta Degener, Norm Diamond, Jeff Dunlop, Ray Dunn, Stephen M. Dunn, Michael J. Eager, Dave Eisen, Bjorn Engsig, Chris Flatters, Rod Flores, Alexander Forst, Jeff Francis, Dave Gillespie, Samuel Goldstein, Alasdair Grant, Ron Guilmette, Doug Gwyn, Tony Hansen, Joe Harrington, Guy Harris, Elliotte Rusty Jones, Kin-ichi Kitano, Peter Klausler, Andrew Koenig, Tom Koenig, Ajoy Krishnan T, Markus Kuhn, John Lauro, Felix Lee, Mike Lee, Timothy J. Lee, Tony Lee, Don Libes, Christopher Lott, Tim Love, Tim McDaniel, Stuart MacMartin, John R. MacMillan, Bob Makowski, Evan Manning, Barry Margolin, George Matas, Brad Mears, Bill Mitchell, Mark Moraes, Darren Morby, Ken Nakata, Landon Curt Noll, David O'Brien, Richard A. O'Keefe, Hans Olsson, Philip (email@example.com), Andrew Phillips, Christopher Phillips, Francois Pinard, Dan Pop, Kevin D. Quitt, Pat Rankin, J. M. Rosenstock, Erkki Ruohtula, Tomohiko Sakamoto, Rich Salz, Chip Salzenberg, Paul Sand, DaviD W. Sanderson, Christopher Sawtell, Paul Schlyter, Doug Schmidt, Rene Schmit, Russell Schulz, Patricia Shanahan, Peter da Silva, Joshua Simons, Henry Spencer, David Spuler, Melanie Summit, Erik Talvola, Clarke Thatcher, Wayne Throop, Chris Torek, Andrew Tucker, Goran Uddeborg, Rodrigo Vanegas, Jim Van Zandt, Wietse Venema, Ed Vielmetti, Larry Virden, Chris Volpe, Mark Warren, Larry Weiss, Freek Wiedijk, Lars Wirzenius, Dave Wolverton, Mitch Wright, Conway Yee, and Zhuo Zang, who have contributed, directly or indirectly, to this article. Special thanks to Karl Heuer, and particularly to Mark Brader, who (to borrow a line from Steve Johnson) have goaded me beyond my inclination, and occasionally beyond my endurance, in relentless pursuit of a better FAQ list.
This article is Copyright 1988, 1990-1995 by Steve Summit.
It may be freely redistributed so long as the author's name, and this
notice, are retained.
The C code in this article (
error(), etc.) is public domain
and may be used without restriction.