๐”– Scriptorium
โœฆ   LIBER   โœฆ

๐Ÿ“

Programming in C++, 2nd Edition

โœ Scribed by Safari, an O'Reilly Media Company.; Kamthane, Ashok


Publisher
Pearson India
Year
2013
Tongue
English
Leaves
904
Series
Always learning
Edition
2nd edition
Category
Library

โฌ‡  Acquire This Volume

No coin nor oath required. For personal study only.

โœฆ Synopsis


The revised and updated version of the student-friendly, practical and example-driven book, Programming in C++, continues to give its readers a solid background and a learning platform to the fundamentals of C++. This comprehensive book, enriched with illustrations and a number of solved programs, will help the students to master this subject.

โœฆ Table of Contents


Cover......Page 1
Brief Contents......Page 4
Contents......Page 6
Preface......Page 16
About the Author......Page 18
1.1 Differences between C and C++......Page 20
1.4 The Object Oriented Technology......Page 21
1.5 Disadvantage of Conventional Programming......Page 23
(2) Procedural/Structured Programming......Page 24
1.7 Preface to Object Oriented Programming......Page 25
1.8 Key Concepts of Object Oriented Programming......Page 26
(2) Classes......Page 27
(3) Method......Page 29
(5) Encapsulation......Page 30
(7) Polymorphism......Page 31
(9) Message passing......Page 32
(11) Delegation......Page 33
1.9 Advantages of OOP......Page 34
1.10 Object Oriented Languages......Page 35
1.11 Usage of OOP......Page 36
Summary......Page 37
Exercises......Page 38
2.2 Steps to Create and Execute a C++ Program......Page 40
2.3 Flowchart for Creating a Source File, Compiling, Linkingand Executing in C++......Page 41
2.4 C++ Environments......Page 42
Step 2: Write the Code for the Program......Page 43
Step 3: Save the File with .CPP AS an Extension......Page 44
Step 4: Compile the Program......Page 45
2.6 Structure of a C++ Program......Page 46
2.7 Illustrative Simple Program in C++ without Class......Page 47
2.8 Header Files and Libraries......Page 48
Summary......Page 49
Exercises......Page 50
3.1 Introduction......Page 52
3.3 Pre-defined Streams......Page 53
3.4 Buffering......Page 54
3.5 Stream Classes......Page 55
3.6 Formatted and Unformatted Data......Page 56
Input and Output Streams......Page 57
3.8 Type Casting with the cout Statement......Page 63
3.9 Member Functions of the istream Class......Page 75
3.10 Formatted Console I/O Operations......Page 78
3.11 Bit Fields......Page 86
3.12 Flags without Bit Fields......Page 89
3.13 Manipulators......Page 90
3.14 User-defined Manipulators......Page 93
3.15 Manipulator with One Parameter......Page 95
3.16 Manipulators with Multiple Parameters......Page 96
3.17 More Programs......Page 98
Summary......Page 106
Exercises......Page 107
4.1 Introduction......Page 118
4.2.1 Keywords......Page 119
4.2.2 Identifiers......Page 120
4.2.3 Constants......Page 121
4.3.2 Variable Declaration......Page 127
4.3.3 Initialization......Page 128
4.3.4 Dynamic Initialization......Page 131
4.4 Data Types in C++......Page 134
4.4.1 Basic Data Type......Page 135
4.4.2 Derived Data Type......Page 136
4.4.3 User-Defined Data Type......Page 142
4.5 Operators in C and C++......Page 148
4.5.1 Precedence of Operators in C++......Page 149
4.5.2 Precedence of * and [ ] Operators......Page 150
4.7 Namespace......Page 152
4.8.1 new Operator......Page 156
4.8.2 delete Operator......Page 158
4.9 Comments......Page 160
4.10 Comma Operator......Page 161
4.11 Comma in Place of Curly Braces......Page 162
4.12 More Programs......Page 164
Summary......Page 174
Exercises......Page 175
5.1 Introduction......Page 180
5.2 The if Statement......Page 181
5.3 Multiple ifs......Page 184
5.4 The if-else Statement......Page 186
5.5 Nested if-else Statements......Page 188
5.6 The else-if Ladder......Page 190
5.7.1 The goto statement......Page 194
5.7.3 The continue Statement......Page 195
5.8 The switch Statement......Page 196
5.9 Nested switch case......Page 201
Summary......Page 202
Exercises......Page 203
6.2 What is a Loop?......Page 206
6.3 The for Loop......Page 207
6.4 Nested for Loops......Page 210
6.5 The while Loop......Page 211
6.6 The do-while Loop......Page 214
6.7 The do-while Statement with while Loop......Page 215
6.8 More Programs......Page 216
Exercises......Page 218
7.1 Introduction......Page 222
7.2.1 Function Prototype Declaration......Page 224
7.2.2 Function Call......Page 225
7.2.3 Function Definition......Page 226
7.3.1 Call by Value......Page 228
7.3.2 Call by Address......Page 229
7.3.3 Call by Reference......Page 231
7.4.1 Lvalues (Left Values)......Page 234
7.5 Return by Reference......Page 235
7.6 Returning More Values by Reference......Page 236
7.7 Default Arguments......Page 237
7.8 const Arguments......Page 241
7.9 Inputting Default Arguments......Page 243
7.10 Inline Functions......Page 244
7.11 Function Overloading......Page 247
7.12 Principles of Function Overloading......Page 249
7.13 Precautions with Function Overloading......Page 253
7.14.1 Rules for Recursive Function......Page 254
7.15.1 Ceil, ceill and floor, floorl......Page 256
7.15.3 abs, fabs, and labs......Page 257
7.15.4 norm......Page 258
7.15.5 complex(), real(), imag(), and conj()......Page 259
7.16 More Programs......Page 260
Exercises......Page 271
Chapter 8 : Classes and Objects......Page 276
8.1 Introduction......Page 277
8.2 Structure in C......Page 278
8.3 Structure in C++......Page 280
8.4 Classes in C++......Page 281
8.5 Declaring Objects......Page 282
8.6 The public Keyword......Page 283
8.7 The private Keyword......Page 284
8.8 The protected Keyword......Page 285
8.9 Access Specifiers and their Scope......Page 286
8.10.1 Member Function Inside the class......Page 287
8.10.2 Private Member Function......Page 289
8.10.3 Member Function Outside the class......Page 290
8.12 Outside Member Function as Inline......Page 291
8.14 Data Hiding or Encapsulation......Page 293
8.15 Classes, Objects, and Memory......Page 296
8.16 static Member Variables......Page 299
8.17 static Member Functions......Page 305
8.17.1 static Private Member Function......Page 306
8.17.2 static Public Member Variable......Page 307
8.18 static Object......Page 308
8.19 Array of Objects......Page 309
8.20 Objects as Function Arguments......Page 311
8.21 friend Functions......Page 314
8.21.1 friend Classes......Page 321
8.22 The const Member Functions......Page 323
8.23 The Volatile Member Function......Page 324
8.24 Recursive Member Function......Page 325
8.25 Local Classes......Page 326
8.27 Member Function and Non-member Function......Page 329
8.28 The main() Function as a Member Function......Page 330
8.29 Overloading Member Functions......Page 331
8.30 Overloading main() Functions......Page 332
8.31 The main(), Member Function, and Indirect Recursion......Page 333
8.32 Bit Fields and Classes......Page 336
8.33 Nested Class......Page 338
8.34 More Programs......Page 339
8.34.1 Member Function Inside the class......Page 346
8.34.2 Member Function Outside the class......Page 347
8.34.3 Private Member Functions......Page 349
Summary......Page 358
Exercises......Page 359
Chapter 9 : Constructors and Destructors......Page 364
9.1 Introduction......Page 365
9.2 Constructors and Destructors......Page 367
9.3.2 Destructors......Page 368
9.4 Applications with Constructors......Page 369
9.5 Constructors with Arguments (Parameterized Constructor)......Page 372
9.6 Overloading Constructors (Multiple Constructors)......Page 374
9.7 Array of Objects Using Constructors......Page 378
9.8 Constructors with Default Arguments......Page 379
9.9 Copy Constructors......Page 380
9.10 The const Objects......Page 382
9.11 Destructors......Page 383
9.12 Calling Constructors and Destructors......Page 386
9.13 Qualifier and Nested Classes......Page 389
9.14 Anonymous Objects......Page 391
9.15 Private Constructors and Destructors......Page 393
9.16 Dynamic Initialization Using Constructors......Page 394
9.17 Dynamic Operators and Constructors......Page 396
9.18 main() as a Constructor and Destructor......Page 398
9.19 Recursive Constructors......Page 399
9.20 Program Execution Before main()......Page 400
9.21 Constructor and Destructor with Static Members......Page 402
9.22 Local Versus Global Object......Page 403
9.23 More Programs......Page 404
Exercises......Page 411
10.1 Introduction......Page 414
10.2 The Keyword Operator......Page 417
10.3 Overloading Unary Operators......Page 419
10.4 Operator Return Type......Page 422
10.5 Constraint on Increment and Decrement Operators......Page 423
10.6 Overloading Binary Operators......Page 424
10.7 Overloading with friend Function......Page 428
10.8 Overloading Assignment Operator (=)......Page 431
10.9 Type Conversion......Page 433
10.9.1 Conversion from Basic to Class Type......Page 434
10.9.2 Conversion from Class Type to Basic Data Type......Page 435
10.9.3 Conversion from One Class Type to Another Class Type......Page 437
10.10 Rules for Overloading Operators......Page 441
10.11 One-Argument Constructor and Operator Function......Page 443
10.12 Overloading Stream Operators......Page 444
10.13 More Programs......Page 446
Summary......Page 457
Exercises......Page 458
Chapter 11 : Inheritance......Page 460
11.3 Access Specifiers and Simple Inheritance......Page 461
11.4 Protected Data with Private Inheritance......Page 468
11.5 Types of Inheritance......Page 473
11.6 Single Inheritance......Page 475
11.7 Multilevel Inheritance......Page 476
11.8 Multiple Inheritance......Page 478
11.9 Hierarchical Inheritance......Page 479
11.10 Hybrid Inheritance......Page 481
11.11 Multipath Inheritance......Page 484
11.12 Virtual Base Classes......Page 485
11.13 Constructors, Destructors, and Inheritance......Page 487
11.13.1 Constructors and destructors in base and derived classes......Page 488
11.13.2 Base and derived classes without constructors......Page 493
11.13.4 Base class without constructors and derived class with constructors......Page 494
11.13.5 Base and derived classes with constructors......Page 495
11.13.6 Base class with various constructors and derived class with one constructor......Page 496
11.13.7 Base and derived classes without default constructors......Page 497
11.13.8 Constructors and multiple inheritance......Page 498
11.13.9 Constructors in multiple inheritance with explicit calls......Page 499
11.13.10 Multiple inheritance and virtual class......Page 500
11.13.11 Execution of constructors in multilevel inheritance......Page 501
11.14 Object as a Class Member......Page 502
11.16 Qualifier Classes and Inheritance......Page 508
11.17 Constructors in Derived Class......Page 509
11.18 Pointers and Inheritance......Page 510
11.19 Overloading Member Function......Page 511
11.22 More Programs......Page 513
Summary......Page 524
Exercises......Page 525
12.2 One-dimensional Array Declaration and Initialization......Page 530
12.3 Characteristics of Arrays......Page 531
12.4 Accessing Array Elements Through Pointers......Page 534
12.5 Arrays of Pointers......Page 535
12.6 Passing Array Elements to a Function......Page 536
12.7 Passing Complete Array Elements to a Function......Page 537
12.8 Initialization of Arrays Using Functions......Page 538
12.9 Two-dimensional Arrays......Page 539
12.10 Pointers and Two-dimensional Arrays......Page 542
12.11 Three- or Multi-dimensional Arrays......Page 543
12.12 Arrays of Classes......Page 544
Summary......Page 547
Exercises......Page 548
13.1 Introduction......Page 550
13.2 Features of Pointers......Page 551
13.3 Pointer Declaration......Page 552
13.4 Arithmetic Operations with Pointers......Page 555
13.5 Pointer to Pointer......Page 557
13.6 void Pointers......Page 558
13.7 wild Pointers......Page 559
13.8 Pointer to Class......Page 561
13.9 Pointer to Object......Page 563
13.10 The this Pointer......Page 565
13.11 Pointer to Derived Classes and Base Class......Page 569
13.12 Pointer to Members......Page 573
13.13 Accessing Private Members with Pointers......Page 580
13.14 Direct Access to Private Members......Page 581
13.15 Addresses of Objects and void Pointers......Page 583
13.16 More Programs......Page 584
Exercises......Page 592
14.2 Memory Models......Page 596
14.3 Dynamic Memory Allocation......Page 600
14.4 The new and delete Operators......Page 601
14.5 Heap Consumption......Page 605
14.6 Overloading new and delete Operators......Page 607
14.7 Overloading new and delete in Classes......Page 611
14.8 Execution Sequence of Constructor and Destructor......Page 614
14.9 Specifying Address of an Object......Page 616
14.10 Dynamic Objects......Page 617
14.11 Calling Convention......Page 618
Summary......Page 619
Exercises......Page 620
15.1 Introduction......Page 622
15.2.1 Static (Early) Binding......Page 623
15.2.2 Dynamic (Late) Binding......Page 626
15.3 Pointer to Base and Derived Class Objects......Page 628
15.4 Virtual Functions......Page 631
15.5 Rules for Virtual Functions......Page 632
15.6 Array of Pointers......Page 634
15.7 Pure Virtual Functions......Page 637
15.8 Abstract Classes......Page 638
15.9 Working of Virtual Functions......Page 640
15.10 Virtual Functions in Derived Classes......Page 646
15.11 Object Slicing......Page 648
15.12 Constructors and Virtual Functions......Page 650
15.13 Virtual Destructors......Page 651
15.14 Destructors and Virtual Functions......Page 653
Exercises......Page 654
16.1 Introduction......Page 658
16.2 File Stream Classes......Page 660
16.3 Steps of File Operations......Page 662
16.4 Checking for Errors......Page 669
16.5 Finding End of a File......Page 672
16.6 File Opening Modes......Page 674
16.7 File Pointers and Manipulators......Page 676
16.8 Manipulators with Arguments......Page 680
16.9 Sequential Access Files......Page 683
16.10 Binary and ASCII Files......Page 685
16.11 Random Access Operation......Page 689
16.12 Error Handling Functions......Page 693
16.13 Command-Line Arguments......Page 698
16.14 Strstreams......Page 699
16.15 Sending Output to Devices......Page 701
16.16 More Programs......Page 703
Summary......Page 710
Exercises......Page 711
Chapter 17 : Generic Programming with Templates......Page 716
17.3 Definition of Class Templates......Page 717
17.4 Normal Function Templates......Page 720
17.6 Class Templates with More Parameters......Page 723
17.7 Function Templates with More Arguments......Page 724
17.8 Overloading of Template Functions......Page 727
17.9 Member Function Templates......Page 728
17.10 Recursion with Template Functions......Page 729
17.11 Class Templates with Overloaded Operators......Page 730
17.12 Class Templates Revisited......Page 732
17.13 Class Templates and Inheritance......Page 734
17.14 Bubble Sort Using Function Templates......Page 736
17.15 Guidelines for Templates......Page 737
17.16 Differences Between Templates and Macros......Page 738
17.17 Linked Lists with Templates......Page 739
17.18 More Programs......Page 741
Summary......Page 746
Exercises......Page 747
18.1 Introduction......Page 750
18.2 Moving From C String to C++ String......Page 753
18.3 Declaring and Initializing String Objects......Page 754
18.4 Relational Operators......Page 757
18.5 Handling String Objects......Page 759
18.6 String Attributes......Page 762
18.7 Accessing Elements of Strings......Page 766
18.8 Comparing and Exchanging......Page 769
18.9 Miscellaneous Functions......Page 771
18.10 More Programs......Page 773
Exercises......Page 776
19.1 Introduction......Page 778
19.3 The Keywords try, throw, and catch......Page 779
19.4 Guidelines for Exception Handling......Page 780
19.5 Multiple catch Statements......Page 784
19.6 Catching Multiple Exceptions......Page 786
19.7 Re-throwing Exception......Page 787
19.8 Specifying Exceptions......Page 788
19.9 Exceptions in Constructors and Destructors......Page 790
19.10 Controlling Uncaught Exceptions......Page 792
19.11 Exceptions and Operator Overloading......Page 793
19.12 Exceptions and Inheritance......Page 795
19.13 Class Templates with Exception Handling......Page 796
19.14 Guidelines for Exception Handling......Page 797
19.15 More Programs......Page 798
Summary......Page 800
Exercises......Page 801
20.1 Introduction to STL......Page 804
20.3 Containers......Page 805
20.4 Sequence Containers......Page 806
20.6 Algorithms......Page 808
20.7 Iterators......Page 813
20.8 Vectors......Page 814
20.9 Lists......Page 820
20.10 Maps......Page 827
20.11 Function Objects......Page 830
Summary......Page 833
Exercises......Page 834
21.1 Introduction......Page 836
21.2 Innovative Data Types......Page 837
21.3 New Type-casting Operators......Page 840
21.4 The Keyword explicit......Page 845
21.5 The Keyword mutable......Page 846
21.6 Namespace Scope......Page 847
21.7 Nested Namespaces......Page 848
21.9 The Keyword using......Page 849
21.11 The Standard Namespace std......Page 854
21.12 Ansi and Turbo-C++ Keywords......Page 855
21.13 Ansi and Turbo-C++ Header Files......Page 858
Summary......Page 859
Exercises......Page 860
22.1 Introduction......Page 862
22.4 Initilisation of Graphics......Page 863
22.5 Few Additional Graphics Functions......Page 865
22.6 Programs Using Library Functions......Page 867
22.7 Working with Texts......Page 875
22.8 Filling Patterns with Different Colors and Styles......Page 877
22.9 Mouse Programming......Page 881
22.10 Drawing Noncommon Figures......Page 885
Exercises......Page 886
Appendices......Page 888
Index......Page 898


๐Ÿ“œ SIMILAR VOLUMES


Programming C# (2nd Edition)
โœ Jesse Liberty ๐Ÿ“‚ Library ๐Ÿ“… 2002 ๐Ÿ› O'Reilly Media ๐ŸŒ English

I have read many (and I do mean many) software books (including all those on my way to my grad degree.) Jesse Liberty is one of the best. This was the first book I bought by him and he is on the top of my list of great writers in the technical field. I usually only write reviews if something is r

C Programming Language, 2nd Edition
โœ Brian W. Kernighan, Dennis M. Ritchie ๐Ÿ“‚ Library ๐Ÿ“… 1988 ๐Ÿ› Pearson ๐ŸŒ English

<p><span>The authors present the complete guide to ANSI standard C language programming. Written by the developers of C, this new version helps readers keep up with the finalized ANSI standard for C while showing how to take advantage of C's rich set of operators, economy of expression, improved con

C Programming Language, 2nd Edition
โœ Brian W. Kernighan, Dennis M. Ritchie ๐Ÿ“‚ Library ๐Ÿ“… 1988 ๐Ÿ› Pearson ๐ŸŒ English

<p>The authors present the complete guide to ANSI standard C language programming. Written by the developers of C, this new version helps readers keep up with the finalized ANSI standard for C while showing how to take advantage of C's rich set of operators, economy of expression, improved control f