High-quality programming guide: C ++/C Language

Source: Internet
Author: User

High-quality programming guide: C ++/C Language
Basic Information
Author: Lin Rui Han Yongquan [Translator's introduction]
Press: Electronic Industry Press
ISBN: 9787121186172
Mounting time:
Published on: February 1, October 2012
Start: 16
Page number: 412
Version: 1-1
Category: Computer> Software and programming> C/Turbo C> C
Computer> Software and program design> C ++

For more information, high quality programming guide: C ++/C Language
Introduction
Books
Computer books
High-quality program design is a weak link in the software industry. Most enterprises have paid a high price for it and can only improve the quality of software products through a large number of tests and errors. Therefore, it is one of the main challenges for IT enterprises to learn how to allow programmers to master programming technologies and specifications and build high-quality code in the development process.
The high quality programming guide: C ++/C language describes the high quality software development methods and C ++/C Programming specifications with a simple and humorous tone, this is also a summary of the author's years of experience in software development. The book consists of 17 chapters, Chapter 1st to Chapter 4th, focusing on software quality and basic programming methods; chapter 1 to Chapter 5th focuses on C ++/C programming style, object-oriented programming methods and some technical topics; chapter 16th describes the principles and usage of STL.
High quality programming guide: C ++/C language versions 1st and 2nd have been widely used by many software developers in domestic IT enterprises. Appendix C "ten years of university" in this book is a short biography published by the author on the Internet. The passionate learning and life attitude described in this article has infected a large number of students.
The high quality programming guide: C ++/C language is intended for IT enterprise programmers and project managers, as well as undergraduates and graduate students in colleges and universities.
Directory
High-quality programming guide: C ++/C Language
Chapter 1 high quality software development 1
1.1 Basic concepts of software quality 1
1.1.1 how to understand software quality 1
1.1.2 Basic Methods for Improving Software Quality 2
1.1.3 "zero defect" concept 4
1.2 elaborate on software quality attribute 4
1.2.1 correctness 4
1.2.2 robustness 4
1.2.3 reliability 5
1.2.4 performance 6
1.2.5 ease of use 6
1.2.6 clarity 7
1.2.7 security 7
1.2.8 scalability 8
1.2.9 compatibility 8
1.2.10 portability 8
1.3 people focus not only on quality 9
1.3.1 relationship between quality, productivity and cost 9
1.3.2 basic concepts of software process improvement 10
1.4 basic methods for high-quality software development 13
1.4.1 establish software process specification 13
1.4.2 reuse 15
1.4.3 divide and conquer 16
1.4.4 optimization and compromise 17
1.4.5 technical review 17
1.4.6 test 19
1.4.7 Quality Assurance 21
1.4.8 error 22
1.5 some common knowledge and Thoughts on software development 23
1.5.1 is there the best programming language? 23
1.5.2 is programming an art? 23
1.5.3 should I use more programming skills? 24
1.5.4 for faster computers or faster algorithms 24
1.5.5 should the error be classified into 24 levels?
1.5.6 incorrect ideas 25
1.6 Conclusion 25
Chapter 1 Brief History of Programming Language Development 27
2.1 programming language event 27
2.2 Ada story 31
2.3 A Brief History of C/C ++ development 31
2.4 battle between Borland and Microsoft 32
2.5 Java camp vs. Microsoft contest 33
2.6 summary 36
Chapter 1 Basic concepts of procedures 37
3.1 programming language 37
3.2 language implementation 38
3.3 library 40
3.4 Development Environment 40
3.5 how the program works 41
3.6 good programming habits 42
Chapter 4 C ++/C Programming 45
4.1 basic concepts of C ++/C Programs 45
4.1.1 start function main () 45
4.1.2 command line parameter 47
4.1.3 internal name 48
4.1.4 Connection Specification 49
4.1.5 variables and their initialization 51
4.1.6 C Runtime Library 52
4.1.7 differences between compile time and runtime 52
4.1.8 compilation unit and independent compilation technology 54
4.2 basic data type and memory image 54
4.3 type conversion 56
4.3.1 implicit conversion 56
4.3.2 forced conversion 58
4.4 identifier 60
4.5 escape sequence 61
4.6 Operator 62
4.7 expression 63
4.8 basic control structure 65
4.9 select (judge) structure 65
4.9.1 comparison between Boolean variables and zero values 66
4.9.2 comparison between Integer Variables and zero values 67
4.9.3 comparison between floating point variables and zero values 67
4.9.4 comparison between pointer variables and zero values 69
4.9.5 supplement to the IF statement 69
4.9.6 switch structure 70
4.10 repeating structure 71
4.10.1 for statement loop control variable 72
4.10.2 efficiency of loop statements 73
4.11 structured program design principles 78
4.12 goto/Continue/break statement 79
4.13 example 79
Chapter 3 C ++/C constant 85
5.1 recognize constants 85
5.1.1 literal constant 85
5.1.2 symbolic constant 86
5.1.3 contractual constant 87
5.1.4 enumeration constant 87
5.2 correctly define the symbolic constant 87
5.3 comparison between const and # define 88
Constant 89 in the 5.4 class
5.5 how to define a constant 90 in practical applications
Chapter 4 C ++/c Function Design Basics 95
6.1 recognize function 95
6.2 function prototype and definition 96
6.3 function call method 97
6.4 identify function stack 99
6.5 function call specification 100
6.6 function Connection Specification 101
6.7 parameter transfer rule 102
6.8 rules for returning values 104
6.9 rules implemented inside the function 107
6.10 storage type and scope rules 109
6.10.1 storage 109
6.10.2 scope rule 110
6.10.3 connection type 111
6.11 recursive functions 113
6.12 use assertion 116
6.13 use const to improve the robustness of functions 118
6.13.1 use const to modify function parameters 118
6.13.2 use const to modify the return value of the function 119
Chapter 2 C ++/C pointers, arrays, and strings 7th
7.1 pointer 121
7.1.1 essence of pointer 121
7.1.2 pointer types and supported operations 123
7.1.3 pointer transfer 125
7.2 array 126
7.2.1 essence of arrays 126
7.2.2 2D array 128
7.2.3 array transfer 129
7.2.4 Method for dynamically creating, initializing, and deleting arrays 131
7.3 character array, character pointer, and string 133
7.3.1 relationship between character arrays, strings, and '\ 0': 133
7.3.2 misunderstanding of character pointer 134
7.3.3 string copying and comparison 134
7.4 function pointer 134
7.5 Comparison Between Reference and pointer 137
Chapter 2 C ++/C advanced data types 8th
8.1 structure (struct) 141
8.1.1 confusion between the keywords struct and class 141
8.1.2 use struct 142
8.1.3 bit domain 145
8.1.4 alignment 147
8.2 Union 159
8.3 enumeration (Enum) 161
8.4 file 162
Chapter 2 C ++/C compilation preprocessing 9th
9.1 file contains 165
9.1.1 internal and external includes guard 165
9.1.2 reasonable sequence of header file inclusion 166
9.2 macro definition 166
9.3 Conditional compilation 169
9.3.1 # If, # Elif, and # else 169
9.3.2 # ifdef & # ifndef 170
9.4 # error 170
9.5 # pragma 171
9.6 # And # operators 171
9.7 predefined symbolic constant 172
Chapter 4 C ++/C file structure and layout 10th
10.1 directory structure of program files 173
10.2 file structure 174
10.2.1 use and structure of header files 174
10.2.2 copyright and version 175
10.2.3 source file structure 176
10.3 code layout 176
10.3.1 appropriate empty row 176
10.3.2 code line and line space 177
10.3.3 long row splitting 178
10.3.4 align and indent 179
10.3.5 modifier location 180
10.3.6 comment style 180
10.3.7 ADT/UDT layout 181
Chapter 2 C ++/C Application naming rules 11th
11.1 common rules 183
11.2 simple Windows Application name 184
Chapter 2 C ++ Object-Oriented Programming Method overview 12th
12.1 introduction to object-oriented 187
12.2 concepts of objects 188
12.3 Information Hiding and class encapsulation 189
12.4 class inheritance 193
12.5 class combination features 199
12.6 Dynamic Features 200
12.6.1 virtual function 200
12.6.2 abstract base 201
12.6.3 dynamically binding 203
12.6.4 Runtime polymorphism 206
12.6.5 polymorphism array 207
12.7 C ++ object model 214
12.7.1 memory image 214 of the object
12.7.2 implicit member 224
12.7.3 how the C ++ compiler processes member functions 225
12.7.4 how does the C ++ compiler handle static member 225?
12.8 conclusion 226
Chapter 2 object initialization, copying, and analysis 13th
13.1 constructor and destructor origin 229
13.2 why constructor and destructor 230
13.3 member initialization list of the constructor 232
13.4 object structure and structure order 234
13.5 time for calling constructor and destructor 235
13.6 overload of constructor and value assignment function 236
13.7 example: constructor and destructor of the string class 238
13.8 when should we define the copy constructor and the copy assignment function? 239
13.9 example: copy constructor and copy assignment function of the string type 240
13.10 use a lazy method to process the copy constructor and the copy assignment function 242
13.11 how to implement basic functions of a derived class 243
Chapter 2 advanced features of C ++ functions 14th
14.1 concept of function overloading 247
14.1.1 origins of heavy loads 247
14.1.2 how to implement the 247 overload?
14.1.3 be careful with implicit type conversion, leading to ambiguity of the overloaded function 249
14.2 reload, overwrite, and hide member functions 250
14.2.1 250 heavy load and coverage
14.2.2 confusing hiding rules 251
14.2.3 get rid of hiding 253
14.3 default value: 254
14.4 operator overload 255
14.4.1 concepts 255
14.4.2 special features of Operator Overloading 256
14.4.3 operator 257 that cannot be overloaded
14.4.4 heavy load ++ and -- 257
14.5 function inline 259
14.5.1 replacing macro 259 with function inline
14.5.2 programming style of inline functions 260
14.5.3 use inline 261 with caution
14.6 type conversion function 261
14.7 const member functions 264
Chapter 3 C ++ Exception Handling and rtti 15th
15.1 why use exception handling 267
15.2 C ++ Exception Handling 268
15.2.1 principle of exception handling 268
15.2.2 exception type and object 269
15.2.3 syntax structure of exception handling 270
15.2.4 exception type Matching Rule 272
15.2.5 exception description and conflict 272
15.2.6 how to release a local object when an exception is thrown
15.2.7 exception 273 during Object Construction and Analysis
15.2.8 how to use exception handling 275
Standard exception of 15.2.9 C ++ 278
15.3 Challenges Facing Virtual functions 278
15.4 rtti and its composition 280
15.4.1 origin 280
15.4.2 typeid operator 281
15.4.3 dynamic_cast [] operation 283
15.4.4 rtti charm and cost 285
Chapter 4 Memory Management 16th
16.1 memory allocation method 287
16.2 common memory errors and Countermeasures 288
16.3 how the pointer parameter transfers 289 of the memory
16.4 what about free and delete pointers? 291
16.5 will dynamic memory be automatically released? 292
16.6 eliminate "wild pointer" 292
16.7 why New/delete 293 is required with malloc/free?
16.8 usage of malloc/free 295
16.9 there are three ways to use new: 296
16.9.1 plain new/delete 296
16.9.2 nothrow new/delete 297
16.9.3 placement new/delete 297
16.10 usage of new/delete 300
16.11 how to deal with memory depletion 301
16.12 simulate pointer with object 302
16.13 generic pointer auto_ptr 305
16.14 smart pointer with reference count 306
16.15 smart pointer as container element 312
Chapter 4 learn and use STL 17th
17.1 STL Introduction 323
17.2 distribution of STL header files: 324
17.2.1 container 324
17.2.2 generic algorithm 325
17.2.3 iterator 325
17.2.4 mathematical operation database 325
17.2.5 common tools 325
17.2.6 other header files 326
17.3 container design principle 326
17.3.1 memory image 326
17.3.2 storage and access methods 327
17.3.3 comparison between sequential containers and associated containers 328
17.3.4 how to traverse container 331
17.3.5 Storage Space reallocation problem 332
17.3.6 what kind of object can be used as element of STL container 333
17.4 iterator 334
17.4.1 essence of iterator 334
17.4.2 iterator failure and Its Risk 337
17.4.3 how to correctly Delete element 346 during container Traversal
17.5 storage distributor 347
17.6 adapter 349
17.7 generic algorithms 352
17.8 some special containers 355
17.8.1 string 356
17.8.2 bitset is not set 356
17.8.3 space-saving vector [bool] 358
17.8.4 empty container 
17.9 STL container feature summary 361
17.10 STL experiences 364
Appendix a c ++/C question 367
Appendix B C ++/C answers and scoring criteria 371
Appendix C University 10 years 377
Appendix D University decade postscript 395
Appendix E glossary 397

Source of this book: China Interactive publishing network

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.