Archive-name: C-faq/faq Comp-lang-c-archive-name: C-FAQ-list URL: http://www.eskimo.com/~scs/C-faq/top.html [Last modified February 7, 1999 by scs.] This article is Copyright 1990-1999 by Steve Summit. Content from the book _C Programming FAQs: Frequently Asked Questions_ is made available here by permission of the author and the publisher as a service to the community. It is intended to complement the use of the published text and is protected by international copyright laws. The content is made available here and may be accessed freely for personal use but may not be republished without permission. 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; see also questions 18.9 and 18.10. Many of the questions and answers are cross-referenced to these books, for further study by the interested and dedicated reader. 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 frequently-asked questions, this article also summarizes frequently-posted 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. (However, this is a large and heavy document, so don't assume that everyone on the newsgroup has managed to read all of it in detail, and please don't roll it up and thwack people over the head with it just because they missed their answer in it.) This article was last modified on February 7, 1999, and its travels may have taken it far from its original home on Usenet. It may, however, be out-of-date, particularly if you are looking at a printed copy or one retrieved from a tertiary archive site or CD-ROM. You should be able to obtain the most up-to-date copy on the web at http://www.eskimo.com/~scs/C-faq/top.html or http://www.faqs.org/faqs/ , or from one of the ftp sites mentioned in question 20.40. Since this list is modified from time to time, its question numbers may not match those in older or newer copies which are in circulation; be careful when referring to FAQ list entries by number alone. 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 hypertext version is available on the web at the aforementioned URL. Finally, for those who might prefer a bound, hardcopy version (and even longer answers to even more questions!), a book-length version has been published by Addison-Wesley (ISBN 0-201-84519-9). This article is always being improved. Your input is welcomed. Send your comments to scs@eskimo.com . The questions answered here are divided into several categories: 1. Declarations and Initializations 2. Structures, Unions, and Enumerations 3. Expressions 4. Pointers 5. Null Pointers 6. Arrays and Pointers 7. Memory Allocation 8. Characters and Strings 9. Boolean Expressions and Variables 10. C Preprocessor 11. ANSI/ISO Standard C 12. Stdio 13. Library Functions 14. Floating Point 15. Variable-Length Argument Lists 16. Strange Problems 17. Style 18. Tools and Resources 19. System Dependencies 20. Miscellaneous Bibliography Acknowledgements (The question numbers within each section are not always continuous, because they are aligned with the aforementioned book-length version, which contains even more questions.) Herewith, some frequently-asked questions and their answers: