Jump to content
YOUR-AD-HERE
HOSTING
TOOLS
992Proxy

Locked Practical C++ Programming Guide


prisonlife

Recommended Posts

I: The Basics 1

1: What Is C++? 3 3

A Brief History of C++ 3

C++ Organization 4

How to Learn C++ 6

2: The Basics of Program Writing 9

Programs from Conception to Execution 12

Creating a Real Program 13

Creating a Program Using a Command-Line Compiler 13

Creating a Program Using an Integrated Development Environment 16

Getting Help in UNIX 32

Getting Help in an Integrated Development Environment 33

Programming Exercises 33

3: Style 35

Comments 36

C++ Code 4 41

Naming Style 42

Coding Religion 43

Indentation and Code Format 43

Page vi

Clarity 44

44

Simplicity 45

Consistency and Organization 46

Further Reading 46

Summary 46

4: Basic Declarations and Expressions 49

The Elements of a Program 49

Basic Program Structure 50

Simple Expressions 51

The cout Output Class 53

Variables and Storage 53

Variable Declarations 54

Integers 55

Assignment Statements 56

Floating Point Numbers 57

Floating Point Versus Integer Divide 58

Characters 59

Programming Exercises 60

Answers Chapter Questions 61

5: Arrays, Qualifiers, and Reading Numbers 63

Arrays 63

Strings 64

Reading Data 67

Initializing Variables 69

Multidimensional Arrays 70

Types of Integers 72

Types of Floats 74

74

Constant and Reference Declarations 74

Qualifiers 76

Hexadecimal and Octal Constants 78

Operators for Performing Shortcuts 78

Side Effects 79

Programming Exercises 82

Answers to Chapter Questions 82

Page vii

6: Decision and Control Statements 85

if Statement 85

else Statement 87

How Not to Use strcmp 88

Looping Statements 88

while Statement 88

Break Statement 91

continue Statement 92

The Assignment Anywhere Side Effect 92

Programming Exercises 94

Answers to Chapter Questions 95

7. The Programming Process 97

Setting Up 99

The Specification 100

Code Design 101

The Prototype 102

The Makefile 103

103

Testing 105

Debugging 106

Maintenance 108

Revisions 108

Electronic Archaeology 109

Mark Up the Program 109

Use the Debugger 110

Use the Text Editor as a Browser 110

Add Comments 110

Programming Exercises 113

II: Simple Programming 115

8: More Control Statements 117

for Statement 117

switch Statement 120

switch, break, and continue 125

Programming Exercises 127

Answers to Chapter Questions 128

Page vii

9: Variable Scope and Functions 129

Scope and Storage Class 129

Functions 133

Summary of Parameter Types 146

Structured Programming Basics 146

Recursion 148

148

Programming Exercises 149

Answers to Chapter Questions 149

10. The C++ Preprocessor 151

#define Statement 151

Conditional Compilation 157

#include Files 159

Parameterized Macros 160

Advanced Features 162

Summary 163

Programming Exercises 163

Answers to Chapter Questions 164

11: Bit Operations 167

Bit Operators 168

The AND Operator (&) 168

Bitwise OR ( | ) 171

The Bitwise Exclusive OR (^) 171

The Ones Complement Operator (NOT) (-) 171

The Left and Right Shift Operators (<<, >>) 172

Setting, Clearing, and Testing Bits 173

Bitmapped Graphics 176

Programming Exercises 181

Answers to Chapter Questions 182

III: Advanced Types and Classes 183

12: Advanced Types 185

Structures 185

185

Unions 188

typedef 190

Page ix

enum Type 191

Bit Fields or Packed Structures 193

Arrays of Structures 195

Programming Exercises 196

13: Simple Classes 197

Stacks 197

Improved Stack 201

Using a Class 203

Introduction to Constructors and Destructors 205

Automatically Generated Member Functions 210

Shortcuts 211

Style 212

Programming Exercises 214

14: More on Classes 217

Friends 217

Constant Functions 219

Constant Members 220

Static Member Variables 222.....

 

This is the hidden content, please

 

:kiss::coo3l:

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.