Programming with C - Byron S. Gottfried.pdf
(
3260 KB
)
Pobierz
SCHAUM’S OUTLINE OF
THEORY AND PROBLEMS
OF
PROGRAMMING
WITH
C
Second Edition
BYRON S. GOTTFRIED, Ph.D.
Professor of Industrial Engineering
University of Pittsburgh
SCHAUM’S OUTLINE SERIES
M
C
GRAW-HILL
New York St. Louis San Francisco Auckland Bogotá Caracas
Lisbon London Madrid Mexico City Milan Montreal
New Delhi San Juan Singapore
Sydney Tokyo Toronto
McGraw-Hill
abc
Copyright © 1996, 1990 by The McGraw-Hill Companies, Inc. All rights reserved. Manufactured in the United States of America.
Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in
any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher.
0-07-136799-3
The material in this eBook also appears in the print version of this title: 0-07-024035-3.
All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trade-
marked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringe-
ment of the trademark. Where such designations appear in this book, they have been printed with initial caps.
McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate
training programs. For more information, please contact George Hoare, Special Sales, at george_hoare@mcgraw-hill.com or (212)
904-4069.
TERMS OF USE
This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and to
the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store
and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative
works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill’s
prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohib-
ited. Your right to use the work may be terminated if you fail to comply with these terms.
THE WORK IS PROVIDED “AS IS”. McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES
AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE
WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR
OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMIT-
ED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill
and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its oper-
ation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to you or anyone else for any inac-
curacy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsi-
bility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill and/or its licen-
sors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inabil-
ity to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply
to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise.
DOI: 10.1036/0071367993
Preface
C has continued to increase in popularity since the publication of the first edition of this book in 1990.
Most newer compilers provide numerous extensions to the 1989 ANSI standard, as well as a full-feature
graphical programming environment including a debugger, a project manager, and extensive on-line help.
Moreover, interest in C has not been diminished by the emergence of C++, since the features found in this
newer programming language require a solid background in C.
This second edition provides instruction in the use of the C language, within the context of contemporary C
programming style. It includes complete and understandable explanations of the commonly used features of C,
including most of the features included in the current ANSI standard. In addition, the book presents a
contemporary approach to programming, stressing the importance of clarity, legibility, modularity and
efficiency in program design. Thus, the reader is exposed to the principles of good programming practice as
well as the specific rules of C. Complete C programs are presented throughout the text, beginning with the first
chapter. The use of an interactive programming style is emphasized throughout the text.
The book can be used by a wide reader audience, ranging from beginning programmers to practicing
professionals. It is particularly well suited for advanced secondary or beginning college-level students as a
textbook for an introductory programming course, as a supplementary text, or as an effective independent-study
guide.
Many examples are included as an integral part of the text. These include numerous programming
examples of varying complexity, as well as illustrative drill-type problems. The sample programs conform to
the ANSI C standard. Many are solved using other programming languages in the companion Schaum’s
Outlines, thus providing the reader with a basis of comparison among several popular languages.
Sets of review questions and drill problems are provided at the end of each chapter. The review questions
enable readers to test their recall of the material presented within each chapter. They also provide an effective
chapter summary. The drill problems reinforce the principles presented within each chapter. The reader
should solve as many of these problems as possible. Answers to most of the drill problems are provided at the
end of the book.
In addition, problems that require the writing of complete C programs are presented at the end of each
chapter, beginning with Chap. 5. The reader is encouraged to write and execute as many of these programs as
possible. This will greatly enhance the reader’s self-confidence and stimulate interest in the subject.
(Computer programming is a demanding skill, much like creative writing or playing a musical instrument. As
such, it cannot be learned simply by reading a textbook!)
Most of these programming problems require no special mathematical or technical background. Hence,
they can be solved by a broad range of readers. When using this book in a programming course, the instructor
may wish to supplement these problems with additional programming exercises that reflect particular
disciplinary interests.
A number of changes have been made to the earlier edition. Chapter 5 has been rewritten, illustrating the
use of C within Borland International’s Turbo C++ programming environment, and the material on debugging
techniques has been rewritten and expanded. The topics in Chap. 6 have been rearranged to correspond to the
order in which they are presented in most introductory programming courses, with branching preceding
looping. Some earlier material on the use of functions, reflecting an older programming style, has been
removed from Chap. 7, and a section on dynamic memory allocation has been added to Chap. 10. Stylistic
changes have been made in most programming examples; in particular, programs involving functions now
emphasize full function prototyping, as recommended by the current ANSI standard.
All of the programming examples and many of the end-of-chapter programming problems have been
solved on an Intel-type (“IBM-compatible”) personal computer, using several different versions of Borland
International’s Turbo C++ compiler. In addition, some of the examples were run on a Digital Equipment VAX
computer, using the versions of C provided by DEC for their VMS operating system.
iii
Copyright 1996, 1990 The McGraw-Hill Companies, Inc. Click Here for Terms of Use.
iv
PREFACE
The principal features of C are summarized in Appendixes A through H at the end of the book. This
material should be used frequently for ready reference and quick recall. It is particularly helpful when writing
or debugging a new program.
B
YRON
S. G
OTTFRIED
Plik z chomika:
jonedave3
Inne pliki z tego folderu:
Paula Deen Celebrates! - Paula Deen.epub
(14603 KB)
Pacific Northwests Best Trips 3.epub
(92587 KB)
P. G. Bell - The Train to Impossible Places.epub
(19719 KB)
P. R. Halmos - A Hilbert Space Problem Book (1974) [978-1-4615-9976-0].pdf
(26003 KB)
P Finnigan - Oracle Incident Response and Forensics.pdf
(2399 KB)
Inne foldery tego chomika:
@other-lang
@packed
0
1
2-1
Zgłoś jeśli
naruszono regulamin