"C&C++ Programming provides a traditional introduction to program development and effective use of C and C++ Programming Language. The content of this book covers basic components of C and C++, data types and structures, Object-Oriented Programming, and its applications. The first basic part of the book tells the essential of C Programming by introducing the basics and structured programming techniques for programming development. It also demonstrates the use of pointers, arrays, functions, and C++ standard libraries which facilitate your programming learning. The following part introduces the notions of input and output, overloading, and one of the most important characteristics of C++, inheritance. The book also talks about Software Engineering with C++. This book includes many examples in each chapter. Some of the examples are short (maybe few lines) yet very important, while some examples are more complicated ones to solve real-life problems. It is suitable for beginners as well as students with prior programming experience. Students who use this book are suggested to read and reproduce these programs in their own C++ environment. The exercises at the end of each chapter focus on the key points of the chapter and some of the exercises are real-life problems which need you to build complete programs from scratch. Hope readers to be more experienced programmers with the help of this book. "
作者简介:
章节目录:
"Chapter 1?Introduction to C&C++ 1
1.1 History 1
1.2 The first C&C++ Programs 4
1.3 Compilation and Linking 6
1.4 Available IDEs 8
Exercises 14
Chapter 2?Basics 15
2.1 Variable Names 15
2.2 Data Types and Sizes 16
2.3 Constants 16
2.4 Declarations 17
2.5 Arithmetic Operators 17
2.6 Relational and Logical Operators 18
2.7 Type Conversions 19
2.8 Increment and Decrement Operators 20
2.9 Bitwise Operators 20
2.10 Assignment Operators and Expressions 22
2.11 Precedence and Associativity 22
2.12 Compound Data Type – Arrays, Structures, Enums and Unions 23
2.13 Bit-fields 23
Exercises 24
Chapter 3?Control Flow 25
3.1 Statements and Blocks 25
3.2 If-else 25
3.3 Switch 29
3.4 Loops 32
3.5 Break and Continue 35
3.6 Goto and Labels 35
Exercises 35
Chapter 4?Pointers and Arrays 37
4.1 Pointers and Addresses 37
4.2 Pointers and Arrays 39
4.3 Pointers and Functions 39
4.4 Pointer Arrays and Pointers to Pointers 44
4.5 Multi-dimensional Arrays 45
4.6 Pointers and Multi-Dimensional Arrays 46
4.7 Arrays of Structures 47
4.8 Pointers to Structures 49
Exercises 52
Chapter 5?Functions 55
5.1 Basics of Functions 55
5.2 Function Arguments and Return 57
5.3 Pointers and Function Arguments 57
5.4 External Variables 57
5.5 Variable Scope 58
5.6 Static Variables 58
5.7 Register Variables 58
5.8 Block Structure 59
5.9 Initialization 60
5.10 Recursion 60
Exercises 62
Chapter 6?Program Structure 64
6.1 Multiple Files Program 64
6.2 The C Preprocessor 66
6.3 Head Files 66
6.4 File Inclusion 69
6.5 Macro Substitution 70
6.6 Conditional Compilation 73
Exercises 74
Chapter 7?Input and Output 75
7.1 Basic Input and Output 75
7.2 Formatted Output – printf 76
7.3 Formatted Input – scanf 82
7.4 IO Stream 86
7.5 File Access 90
Exercises 95
Chapter 8?C++ Object Oriented Programming 96
8.1 From C to C++ 96
8.2 Classes and Objects 97
8.3 Constructors and Destructors 100
8.4 Initializations 107
8.5 Encapsulation and Polymorphism 108
8.6 Templates 113
Exercises 117
Chapter 9?Overloading 118
9.1 Introduction 118
9.2 Function Overloading 118
9.3 Operator Overloading 120
Exercises 137
Chapter 10?Inheritance 138
10.1 Basics 138
10.2 Derived Classes 139
10.3 Access Control 144
10.4 Constructors and Destructors 146
10.5 Virtual Functions 152
10.6 Class Hierarchies 153
Exercises 157
Chapter 11?Software Engineering with C++ 158
11.1 Software Development 158
11.2 OOP Philosophy 160
11.3 Generic Programming and STL 162
Exercises 167
References 168
"