| 000 | 00000cam u2200205 a 4500 | |
| 001 | 000045954757 | |
| 005 | 20180913175332 | |
| 008 | 180912s2014 njua 001 0 eng d | |
| 010 | ▼a 2013953007 | |
| 020 | ▼a 9780321928429 (pbk.) | |
| 020 | ▼a 0321928423 (pbk.) | |
| 035 | ▼a (KERIS)REF000017618927 | |
| 040 | ▼a DLC ▼b eng ▼e rda ▼c DLC ▼d DLC ▼d 211009 | |
| 050 | 0 0 | ▼a QA76.73.C15 ▼b P733 2014 |
| 082 | 0 0 | ▼a 005.13/3 ▼2 23 |
| 084 | ▼a 005.133 ▼2 DDCK | |
| 090 | ▼a 005.133 ▼b P912cp6 | |
| 100 | 1 | ▼a Prata, Stephen. |
| 245 | 1 0 | ▼a C primer plus / ▼c Stephen Prata. |
| 250 | ▼a 6th ed. | |
| 260 | ▼a Upper Saddle River, NJ : ▼b Addison-Wesley, ▼c c2014. | |
| 300 | ▼a xxiv, 1037 p. : ▼b ill. ; ▼c 23 cm. | |
| 490 | 1 | ▼a Developer's library |
| 500 | ▼a Includes index. | |
| 650 | 0 | ▼a C (Computer program language). |
| 830 | 0 | ▼a Developer's library. |
| 945 | ▼a KLPA |
소장정보
| No. | 소장처 | 청구기호 | 등록번호 | 도서상태 | 반납예정일 | 예약 | 서비스 |
|---|---|---|---|---|---|---|---|
| No. 1 | 소장처 과학도서관/Sci-Info(2층서고)/ | 청구기호 005.133 P912cp6 | 등록번호 121245972 (2회 대출) | 도서상태 대출가능 | 반납예정일 | 예약 | 서비스 |
컨텐츠정보
책소개
C Primer Plus is a carefully tested, well-crafted, and complete tutorial on a subject core to programmers and developers. This computer science classic teaches principles of programming, including structured code and top-down design.
?
Author and educator Stephen Prata has created an introduction to C that is instructive, clear, and insightful. Fundamental programming concepts are explained along with details of the C language. Many short, practical examples illustrate just one or two concepts at a time, encouraging readers to master new topics by immediately putting them to use.
?
Review questions and programming exercises at the end of each chapter bring out the most critical pieces of information and help readers understand and digest the most difficult concepts. A friendly and easy-to-use self-study guide, this book is appropriate for serious students of programming, as well as developers proficient in other languages with a desire to better understand the fundamentals of this core language.
?
The sixth edition of this book has been updated and expanded to cover the latest developments in C as well as to take a detailed look at the new C11 standard. In C Primer Plus you’ll find depth, breadth, and a variety of teaching techniques and tools to enhance your learning:
?
- Complete, integrated discussion of both C language fundamentals and additional features
- Clear guidance about when and why to use different parts of the language
- Hands-on learning with concise and simple examples that develop your understanding of a concept or two at a time
- Hundreds of practical sample programs
- Review questions and programming exercises at the end of each chapter to test your understanding
- Coverage of generic C to give you the greatest flexibility
?
정보제공 :
저자소개
스테판 프라타(지은이)
Stephen Prata는 미국 캘리포니아 주 켄필드 시의 마린 대학에서 천문학과 물리학, 프로그래밍을 가르쳤고, 현재는 은퇴했다. 그는 캘리포니아 공과대학에서 학사 학위를 받았고, 버클리 캘리포니아 대학에서 박사 학위를 받았다. 그는 컴퓨터협회에 관여하면서 성단(星團, star clusters)의 컴퓨터 모델링을 시작했다. Stephen은 『C++ 기초 플러스(C++ Primer Plus)』와 『Unix 기초 플러스(Unix Primer Plus)』를 포함하여, 12권 이상의 책을 단독 저술했거나 공저했다.
목차
Preface p. xxvii
1 Getting Ready p. 1
Whence C? p. 1
Why C? p. 2
Design Features p. 2
Efficiency p. 3
Portability p. 3
Power and Flexibility p. 3
Programmer Oriented p. 3
Shortcomings p. 4
Whither C? p. 4
What Computers Do p. 5
High-level Computer Languages and Compilers p. 6
Language Standards p. 7
The First ANSI/ISO C Standard p. 8
The C99 Standard p. 8
The C11 Standard p. 9
Using C: Seven Steps p. 9
Step 1 Define the Program Objectives p. 10
Step 2 Design the Program p. 10
Step 3 Write the Code p. 11
Step 4 Compile p. 11
Step 5 Run the Program p. 12
Step 6 Test and Debug the Program p. 12
Step 7 Maintain and Modify the Program p. 13
Commentary p. 13
Programming Mechanics p. 13
Object Code Files, Executable Files, and Libraries p. 14
Unix System p. 16
The GNU Compiler Collection and the LLVM Project p. 18
Linux Systems p. 18
Command-Line Compilers for the PC p. 19
Integrated Development Environments (Windows) p. 19
The Windows/Linux Option p. 21
C on the Macintosh p. 21
How This Book Is Organized p. 22
Conventions Used in This Book p. 22
Typeface p. 22
Program Output p. 23
Special Elements p. 24
Summary p. 24
Review Questions p. 25
Programming Exercise p. 25
2 Introducing C p. 27
A Simple Example of C p. 27
The Example Explained p. 28
Pass 1 Quick Synopsis p. 30
Pass 2 Program Details p. 31
The Structure of a Simple Program p. 40
Tips on Making Your Programs Readable p. 41
Taking Another Step in Using C p. 42
Documentation p. 43
Multiple Declarations p. 43
Multiplication p. 43
Printing Multiple Values p. 43
While You''re at It-Multiple Functions p. 44
Introducing Debugging p. 46
Syntax Errors p. 46
Semantic Errors p. 47
Program State p. 49
Keywords and Reserved Identifiers p. 49
Key Concepts p. 50
Summary p. 51
Review Questions p. 51
Programming Exercises p. 53
3 Data and C p. 55
A Sample Program p. 55
What''s New in This Program? p. 57
Data Variables and Constants p. 59
Data: Data-Type Keywords p. 59
Integer Versus Floating-Point Types p. 60
The Integer p. 61
The Floating-Point Number p. 61
Basic C Data Types p. 62
The int Type p. 62
Other Integer Types p. 66
Using Characters: Type char p. 71
The _Bool Type p. 77
Portable Types: stdint.h and inttypes.h p. 77
Types float, double, and long double p. 79
Complex and Imaginary Types p. 85
Beyond the Basic Types p. 85
Type Sizes p. 87
Using Data Types p. 88
Arguments and Pitfalls p. 89
One More Example: Escape Sequences p. 91
What Happens When the Program Runs p. 91
Flushing the Output p. 92
Key Concepts p. 93
Summary p. 93
Review Questions p. 94
Programming Exercises p. 97
4 Character Strings and Formatted Input/Output p. 99
Introductory Program p. 99
Character Strings: An Introduction p. 101
Type char Arrays and the Null Character p. 101
Using Strings p. 102
The strlen() Function p. 103
Constants and the C Preprocessor p. 106
The const Modifier p. 109
Manifest Constants on the Job p. 109
Exploring and Exploiting printf() and scanf() p. 112
The printf() Function p. 112
Using printf() p. 113
Conversion Specification Modifiers for printf() p. 115
What Does a Conversion Specification Convert? p. 122
Using scanf() p. 128
The * Modifier with printf() and scanf() p. 133
Usage Tips for printf() p. 135
Key Concepts p. 136
Summary p. 137
Review Questions p. 138
Programming Exercises p. 140
5 Operators, Expressions, and Statements p. 143
Introducing Loops p. 144
Fundamental Operators p. 146
Assignment Operator: = p. 146
Addition Operator: + p. 149
Subtraction Operator: - p. 149
Sign Operators: - and + p. 150
Multiplication Operator: * p. 151
Division Operator: / p. 153
Operator Precedence p. 154
Precedence and the Order of Evaluation p. 156
Some Additional Operators p. 157
The sizeof Operator and the size_t Type p. 158
Modulus Operator: % p. 159
Increment and Decrement Operators: ++ and - p. 160
Decrementing: - p. 164
Precedence p. 165
Don''t Be Too Clever p. 166
Expressions and Statements p. 167
Expressions p. 167
Statements p. 168
Compound Statements (Blocks) p. 171
Type Conversions p. 174
The Cast Operator p. 176
Function with Arguments p. 177
A Sample Program p. 180
Key Concepts p. 182
Summary p. 182
Review Questions p. 183
Programming Exercises p. 187
6 C Control Statements: Looping p. 189
Revisiting the while Loop p. 190
Program Comments p. 191
C-Style Reading Loop p. 192
The while Statement p. 193
Terminating a while Loop p. 194
When a Loop Terminates p. 194
while: An Entry-Condition Loop p. 195
Syntax Points p. 195
Which Is Bigger: Using Relational Operators and Expressions p. 197
What Is Truth? p. 199
What Else Is True? p. 200
Troubles with Truth p. 201
The New _Bool Type p. 203
Precedence of Relational Operators p. 205
Indefinite Loops and Counting Loops p. 207
The for Loop p. 208
Using for for Flexibility p. 210
More Assignment Operators: +=, -=, *=, /=, %= p. 215
The Comma Operator p. 215
Zeno Meets the for Loop p. 218
An Exit-Condition Loop: do while p. 220
Which Loop? p. 223
Nested Loops p. 224
Program Discussion p. 225
A Nested Variation p. 225
Introducing Arrays p. 226
Using a for Loop with an Array p. 228
A Loop Example Using a Function Return Value p. 230
Program Discussion p. 232
Using Functions with Return Values p. 233
Key Concepts p. 234
Summary p. 235
Review Questions p. 236
Programming Exercises p. 241
7 C Control Statements: Branching and Jumps p. 245
The if Statement p. 246
Adding else to the if Statement p. 248
Another Example: Introducing getchar() and putchar() p. 250
The ctype.h Family of Character Functions p. 252
Multiple Choice else if p. 254
Pairing else with if p. 257
More Nested ifs p. 259
Let''s Get Logical p. 263
Alternate Spellings: The iso646.h Header File p. 265
Precedence p. 265
Order of Evaluation p. 266
Ranges p. 267
A Word-Count Program p. 268
The Conditional Operator: ?: p. 271
Loop Aids: continue and break p. 274
The continue Statement p. 274
The break Statement p. 277
Multiple Choice: switch and break p. 280
Using the switch Statement p. 281
Reading Only the First Character of a Line p. 283
Multiple Labels p. 284
switch and if else p. 286
The goto Statement p. 287
Avoiding goto p. 287
Key Concepts p. 291
Summary p. 291
Review Questions p. 292
Programming Exercises p. 296
8 Character Input/Output and Input Validation p. 299
Single-Character I/O: getchar() and putchar() p. 300
Buffers p. 301
Terminating Keyboard Input p. 302
Files, Streams, and Keyboard Input p. 303
The End of File p. 304
Redirection and Files p. 307
Unix, Linux, and Windows Command Prompt Redirection p. 307
Creating a Friendlier User Interface p. 312
Working with Buffered Input p. 312
Mixing Numeric and Character Input p. 314
Input Validation p. 317
Analyzing the Program p. 322
The Input Stream and Numbers p. 323
Menu Browsing p. 324
Tasks p. 324
Toward a Smoother Execution p. 325
Mixing Character and Numeric Input p. 327
Key Concepts p. 330
Summary p. 331
Review Questions p. 331
Programming Exercises p. 332
9 Functions p. 335
Reviewing Functions p. 335
Creating and Using a Simple Function p. 337
Analyzing the Program p. 338
Function Arguments p. 340
Defining a Function with an Argument: Formal Parameters p. 342
Prototyping a Function with Arguments p. 343
Calling a Function with an Argument: Actual Arguments p. 343
The Black-Box Viewpoint p. 345
Returning a Value from a Function with return p. 345
Function Types p. 348
ANSI C Function Prototyping p. 349
The Problem p. 350
The ANSI C Solution p. 351
No Arguments and Unspecified Arguments p. 352
Hooray for Prototypes p. 353
Recursion p. 353
Recursion Revealed p. 354
Recursion Fundamentals p. 355
Tail Recursion p. 356
Recursion and Reversal p. 358
Recursion Pros and Cons p. 360
Compiling Programs with Two or More Source Code Files p. 361
Unix p. 362
Linux p. 362
DOS Command-Line Compilers p. 362
Windows and Apple IDE Compilers p. 362
Using Header Files p. 363
Finding Addresses: The & Operator p. 367
Altering Variables in the Calling Function p. 369
Pointers: A First Look p. 371
The Indirection Operator: * p. 371
Declaring Pointers p. 372
Using Pointers to Communicate Between Functions p. 373
Key Concepts p. 378
Summary p. 378
Review Questions p. 379
Programming Exercises p. 380
10 Arrays and Pointers p. 383
Arrays p. 383
Initialization p. 384
Designated Initializers (C99) p. 388
Assigning Array Values p. 390
Array Bounds p. 390
Specifying an Array Size p. 392
Multidimensional Arrays p. 393
Initializing a Two-Dimensional Array p. 397
More Dimensions p. 398
Pointers and Arrays p. 398
Functions, Arrays, and Pointers p. 401
Using Pointer Parameters p. 404
Comment: Pointers and Arrays p. 407
Pointer Operations p. 407
Protecting Array Contents p. 412
Using const with Formal Parameters p. 413
More About const p. 415
Pointers and Multidimensional Arrays p. 417
Pointers to Multidimensional Arrays p. 420
Pointer Compatibility p. 421
Functions and Multidimensional Arrays p. 423
Variable-Length Arrays (VLAs) p. 427
Compound Literals p. 431
Key Concepts p. 434
Summary p. 435
Review Questions p. 436
Programming Exercises p. 439
11 Character Strings and String Functions p. 441
Representing Strings and String I/O p. 441
Defining Strings Within a Program p. 442
Pointers and Strings p. 451
String Input p. 453
Creating Space p. 453
The Unfortunate gets() Function p. 453
The Alternatives to gets() p. 455
The scanf() Function p. 462
String Output p. 464
The puts() Function p. 464
The fputs() Function p. 465
The printf() Function p. 466
The Do-It-Yourself Option p. 466
String Functions p. 469
The strlen() Function p. 469
The strcat() Function p. 471
The strncat() Function p. 473
The strcmp() Function p. 475
The strcpy() and strncpy() Functions p. 482
The sprintf() Function p. 487
Other String Functions p. 489
A String Example: Sorting Strings p. 491
Sorting Pointers Instead of Strings p. 493
The Selection Sort Algorithm p. 494
The ctype.h Character Functions and Strings p. 495
Command-Line Arguments p. 497
Command-Line Arguments in Integrated Environments p. 500
Command-Line Arguments with the Macintosh p. 500
String-to-Number Conversions p. 500
Key Concepts p. 504
Summary p. 504
Review Questions p. 505
Programming Exercises p. 508
12 Storage Classes, Linkage, and Memory Management p. 511
Storage Classes p. 511
Scope p. 513
Linkage p. 515
Storage Duration p. 516
Automatic Variables p. 518
Register Variables p. 522
Static Variables with Block Scope p. 522
Static Variables with External Linkage p. 524
Static Variables with Internal Linkage p. 529
Multiple Files p. 530
Storage-Class Specifier Roundup p. 530
Storage Classes and Functions p. 533
Which Storage Class? p. 534
A Random-Number Function and a Static Variable p. 534
Roll ''Em p. 538
Allocated Memory: malloc() and free() p. 543
The Importance of free() p. 547
The calloc() Function p. 548
Dynamic Memory Allocation and Variable-Length Arrays p. 548
Storage Classes and Dynamic Memory Allocation p. 549
ANSI C Type Qualifiers p. 551
The const Type Qualifier p. 552
The volatile Type Qualifier p. 554
The restrict Type Qualifier p. 555
The _Atomic Type Qualifier (C11) p. 556
New Places for Old Keywords p. 557
Key Concepts p. 558
Summary p. 558
Review Questions p. 559
Programming Exercises p. 561
13 File Input/Output p. 565
Communicating with Files p. 565
What Is a File? p. 566
The Text Mode and the Binary Mode p. 566
Levels of I/O p. 568
Standard Files p. 568
Standard I/O p. 568
Checking for Command-Line Arguments p. 569
The fopen() Function p. 570
The getc() and putc() Functions p. 572
End-of-File p. 572
The fclose() Function p. 574
Pointers to the Standard Files p. 574
A Simple-Minded File-Condensing Program p. 574
File I/O: fprintf(), fscanf(), fgets(), and fputs() p. 576
The fprintf() and fscanf() Functions p. 576
The fgets() and fputs() Functions p. 578
Adventures in Random Access: fseek() and ftell() p. 579
How fseek() and ftell() Work p. 580
Binary Versus Text Mode p. 582
Portability p. 582
The fgetpos() and fsetpos() Functions p. 583
Behind the Scenes with Standard I/O p. 583
Other Standard I/O Functions p. 584
The int ungetc(int c, FILE *fp) Function p. 585
The int fflush() Function p. 585
The int setvbuf() Function p. 585
Binary I/O: fread() and fwrite() p. 586
The size_t fwrite() Function p. 588
The size_t fread() Function p. 588
The int feof(FILE *fp) and int ferror(FILE *fp) Functions p. 589
An fread() and fwrite() Example p. 589
Random Access with Binary I/O p. 593
Key Concepts p. 594
Summary p. 595
Review Questions p. 596
Programming Exercises p. 598
14 Structures and Other Data Forms p. 601
Sample Problem: Creating an Inventory of Books p. 601
Setting Up the Structure Declaration p. 604
Defining a Structure Variable p. 604
Initializing a Structure p. 606
Gaining Access to Structure Members p. 607
Initializers for Structures p. 607
Arrays of Structures p. 608
Declaring an Array of Structures p. 611
Identifying Members of an Array of Structures p. 612
Program Discussion p. 612
Nested Structures p. 613
Pointers to Structures p. 615
Declaring and Initializing a Structure Pointer p. 617
Member Access by Pointer p. 617
Telling Functions About Structures p. 618
Passing Structure Members p. 618
Using the Structure Address p. 619
Passing a Structure as an Argument p. 621
More on Structure Features p. 622
Structures or Pointer to Structures? p. 626
Character Arrays or Character Pointers in a Structure p. 627
Structure, Pointers, and malloc() p. 628
Compound Literals and Structures (C99) p. 631
Flexible Array Members (C99) p. 633
Anonymous Structures (C11) p. 636
Functions Using an Array of Structures p. 637
Saving the Structure Contents in a File p. 639
A Structure-Saving Example p. 640
Program Points p. 643
Structures: What Next? p. 644
Unions: A Quick Look p. 645
Using Unions p. 646
Anonymous Unions (C11) p. 647
Enumerated Types p. 649
enum Constants p. 649
Default Values p. 650
Assigned Values p. 650
enum Usage p. 650
Shared Namespaces p. 652
typedef: A Quick Look p. 653
Fancy Declarations p. 655
Functions and Pointers p. 657
Key Concepts p. 665
Summary p. 665
Review Questions p. 666
Programming Exercises p. 669
15 Bit Fiddling p. 673
Binary Numbers, Bits, and Bytes p. 674
Binary Integers p. 674
Signed Integers p. 675
Binary Floating Point p. 676
Other Number Bases p. 676
Octal p. 677
Hexadecimal p. 677
C''s Bitwise Operators p. 678
Bitwise Logical Operators p. 678
Usage: Masks p. 680
Usage: Turning Bits On (Setting Bits) p. 681
Usage: Turning Bits Off (Clearing Bits) p. 682
Usage: Toggling Bits p. 683
Usage: Checking the Value of a Bit p. 683
Bitwise Shift Operators p. 684
Programming Example p. 685
Another Example p. 688
Bit Fields p. 690
Bit-Field Example p. 692
Bit Fields and Bitwise Operators p. 696
Alignment Features (C11) p. 703
Key Concepts p. 705
Summary p. 706
Review Questions p. 706
Programming Exercises p. 708
16 The C Preprocessor and the C Library p. 711
First Steps in Translating a Program p. 712
Manifest Constants: #define p. 713
Tokens p. 717
Redefining Constants p. 717
Using Arguments with #define p. 718
Creating Strings from Macro Arguments: The # Operator p. 721
Preprocessor Glue: The ## Operator p. 722
Variadic Macros: ... and __VA_ARGS__ p. 723
Macro or Function? p. 725
File Inclusion: #include p. 726
Header Files: An Example p. 727
Uses for Header Files p. 729
Other Directives p. 730
The #undef Directive p. 731
Being Defined-The C Preprocessor Perspective p. 731
Conditional Compilation p. 731
Predefined Macros p. 737
#line and #error p. 738
#pragma p. 739
Generic Selection (C11) p. 740
Inline Functions (C99) p. 741
_Noreturn Functions (C11) p. 744
The C Library p. 744
Gaining Access to the C Library p. 745
Using the Library Descriptions p. 746
The Math Library p. 747
A Little Trigonometry p. 748
Type Variants p. 750
The tgmath.h Library (C99) p. 752
The General Utilities Library p. 753
The exit() and atexit() Functions p. 753
The qsort() Function p. 755
The Assert Library p. 760
Using assert p. 760
_Static_assert (C11) p. 762
memcpy() and memmove() from the string.h Library p. 763
Variable Arguments: stdarg.h p. 765
Key Concepts p. 768
Summary p. 768
Review Questions p. 768
Programming Exercises p. 770
17 Advanced Data Representation p. 773
Exploring Data Representation p. 774
Beyond the Array to the Linked List p. 777
Using a Linked List p. 781
Afterthoughts p. 786
Abstract Data Types (ADTs) p. 786
Getting Abstract p. 788
Building an Interface p. 789
Using the Interface p. 793
Implementing the Interface p. 796
Getting Queued with an ADT p. 804
Defining the Queue Abstract Data Type p. 804
Defining an Interface p. 805
Implementing the Interface Data Representation p. 806
Testing the Queue p. 815
Simulating with a Queue p. 818
The Linked List Versus the Array p. 824
Binary Search Trees p. 828
A Binary Tree ADT p. 829
The Binary Search Tree Interface p. 830
The Binary Tree Implementation p. 833
Trying the Tree p. 849
Tree Thoughts p. 854
Other Directions p. 856
Key Concepts p. 856
Summary p. 857
Review Questions p. 857
Programming Exercises p. 858
A Answers to the Review Questions p. 861
B Reference Section p. 905
