C All-in-One Desk Reference For Dummies
by Dan Gookin
C All-in-One Desk Reference For Dummies Published by
Wiley Publishing, Inc. 111 River St.
Hoboken, NJ 07030-5774
www.wiley.com Copyright 2004 by Wiley Publishing, Inc., Indianapolis, Indiana Published by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, 201-748-6011, fax 201-748-6008, or online at http://www.wiley.com/go/permissions.
Trademarks: Wiley, the Wiley Publishing logo, For Dummies, the Dummies Man logo, A Reference for the Rest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom.
The fact that an organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations it may make. Further, readers should be aware that Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at 800-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. Wiley also publishes its books in a variety of electronic formats.
Some content that appears in print may not be available in electronic books. Library of Congress Control Number: 2004102339 ISBN: 978-0-7645-7069-8 Manufactured in the United States of America 10 9 8 7 6 5 4 1O/RX/QY/QU/IN
About the Author
Dan Gookin has been writing about technology for 20 years. He has contributed articles to numerous high-tech magazines and written more than 90 books about personal computing technology, many of them accurate. He combines his love of writing with his interest in technology to create books that are informative and entertaining, but not boring. Having sold more than 14 million titles translated into more than 30 languages, Dan can attest that his method of crafting computer tomes does seem to work. Perhaps Dans most famous title is the original
DOS For Dummies, published in 1991.
It became the worlds fastest-selling computer book, at one time moving more copies per week than the New York Times number-one best seller (although, because its a reference book, it could not be listed on the NYT best seller list). That book spawned the entire line of For Dummies books, which remains a publishing phenomenon to this day. Dans most recent titles include PCs For Dummies, 9th Edition; Buying a Computer For Dummies, 2005 Edition; Troubleshooting Your PC For Dummies; Dan Gookins Naked Windows XP; and Dan Gookins Naked Office. He publishes a free weekly computer newsletter, Weekly Wambooli Salad, and also maintains the vast and helpful Web site www.wambooli.com. Dan holds a degree in communications and visual arts from the University of California, San Diego. He lives in the Pacific Northwest, where he enjoys spending time with his four boys in the gentle woods of Idaho.
Publishers Acknowledgments
Were proud of this book; please send us your comments through our online registration form located at www.dummies.com/register/.
Some of the people who helped bring this book to market include the following: Acquisitions, Editorial, and Media Development Project Editor: Rebecca Whitney Acquisitions Editor: Greg Croy Technical Editor: Greg Guntle Editorial Manager: Carol Sheehan Editorial Assistant: Amanda M. Foxworth Cartoons: Rich Tennant, www.the5thwave.com Composition Project Coordinator: Maridee Ennis Layout and Graphics: Karl Brandt, Denny Hager, Joyce Haughey, Stephanie D. Jumper, Michael Kruzil, Melanee Prendergast, Jacque Roth, Julie Trippetti, Mary Gillot Virgin Proofreaders: Arielle Carole Mennelle, Dwight Ramsey, Brian H. Walls Indexer: Infodex Indexing Services Inc. Publishing and Editorial for Technology DummiesRichard Swadley, Vice President and Executive Group Publisher Andy Cummings, Vice President and Publisher Mary Bednarek, Executive Editorial Director Mary C. Corder, Editorial Director Publishing for Consumer DummiesDiane Graves Steele, Vice President and Publisher Joyce Pepple, Acquisitions Director Composition ServicesGerry Fahey, Vice President of Production Services Debbie Stailey, Director of Composition Services
Introduction
C ongratulations on your purchase of
C All-in-One Desk Reference For Dummies a tome that not only sits fat and looks impressive on your computer bookshelf, but also teaches you a heck of a lot about the C programming language.
Because few people read book introductions, I have decided to fill the following six pages with filthy limericks, most of which are patronizing to immigrants and women. Seriously, now that I have your attention, I thought that I would ramble on briefly about this book and what you can expect from its contents. This book provides a solid overview of the C programming language, from the basics on up through advanced concepts and topics that third-year university students would pay real money to have someone else suffer through. Despite the