Showing posts with label Programming Language. Show all posts
Showing posts with label Programming Language. Show all posts

Wednesday, May 23, 2012

Guide to Assembly Language Programming in Linux






Sivarama P. Dandamudi

Contents
Preface vii
PART I Overview 1
1 Assembly Language 3
Introduction 3
What Is Assembly Language? 5
Advantages of High-Level Languages 6
Why Program in Assembly Language? 7
Typical Applications 8
Summary 8
PART II Computer Organization 9
2 Digital Logic Circuits 11
Introduction 11
Simple Logic Gates 13
Logic Functions 15
Deriving Logical Expressions 17
Simplifying Logical Expressions 18
Combinational Circuits 23
Adders 26
Programmable Logic Devices 29
Arithmetic and Logic Units 32
Sequential Circuits 35
Latches 37
Flip-Flops 39
Summary 43
3 Memory Organization 45
Introduction 45
Basic Memory Operations 46
Types of Memory 48
Building a Memory Block 50
Building Larger Memories 52
Mapping Memory 56
Storing Multibyte Data 58
Alignment of Data 59
Summary 60
4 The IA-32 Architecture 61
Introduction 61
Processor Execution Cycle 63
Processor Registers 63
Protected Mode Memory Architecture 67
Real Mode Memory Architecture 72
Mixed-Mode Operation 74
Which Segment Register to Use 75
Input/Output 76
Summary 78
PART III Linux 79
5 Installing Linux 81
Introduction 81
Partitioning Your Hard Disk 82
Installing Fedora Core Linux 92
Installing and Removing Software Packages 107
Mounting Windows File System 110
Summary 112
Getting Help 114
6 Using Linux 115
Introduction 115
Setting User Preferences 117
System Settings 123
Working with the GNOME Desktop 126
Command Terminal 132
Getting Help 134
Some General-Purpose Commands 135
File System 139
Access Permissions 141
Redirection 145
Pipes 146
Editing Files with Vim 147
Summary 149
PART IV NASM 151
7 Installing and Using NASM 153
Introduction 153
Installing NASM 154
Generating the Executable File 154
Assembly Language Template 155
Input/Output Routines 156
An Example Program 159
Assembling and Linking 160
Summary 166
Web Resources 166
8 Debugging Assembly Language Programs 167
Strategies to Debug Assembly Language Programs 167
Preparing Your Program 169
GNU Debugger 170
Data Display Debugger 179
Summary 184
PART V Assembly Language 185
9 A First Look at Assembly Language 187
Introduction 187
Data Allocation 188
Where Are the Operands 193
Overview of Assembly Language Instructions 196
Our First Program 205
Illustrative Examples 206
Summary 209
10 More on Assembly Language 211
Introduction 211
Data Exchange and Translate Instructions 212
Shift and Rotate Instructions 213
Defining Constants 217
Macros 218
Our First Program 221
Illustrative Examples 223
When to Use the XLAT Instruction 227
Summary 229
11 Writing Procedures 231
Introduction 231
What Is a Stack? 233
Implementation of the Stack 234
Stack Operations 236
Uses of the Stack 238
Procedure Instructions 239
Our First Program 241
Parameter Passing 242
Illustrative Examples 248
Summary 252
12 More on Procedures 255
Introduction 255
Local Variables 256
Our First Program 257
Multiple Source Program Modules 260
Illustrative Examples 261
Procedures with Variable Number of Parameters 268
Summary 272
13 Addressing Modes 273
Introduction 273
Memory Addressing Modes 274
Arrays 278
Our First Program 281
Illustrative Examples 282
Summary 289
14 Arithmeticlnstructions 291
Introduction 291
Status Flags 292
Arithmetic Instructions 302
Our First Program 309
Illustrative Examples 310
Summary 316
15 Conditional Execution 317
Introduction 317
Unconditional Jump 318
Compare Instruction 321
Conditional Jumps 322
Looping Instructions 327
Our First Program 328
Illustrative Examples 330
Indirect Jumps 335
Summary 339
16 Logical and Bit Operations 341
Introduction 341
Logical Instructions 342
Shift Instructions 347
Rotate Instructions 353
Bit Instructions 354
Our First Program 355
Illustrative Examples 357
Summary 360
PART VI Advanced Assembly Language 361
17 String Processing 363
String Representation 363
String Instructions 364
Our First Program 372
Illustrative Examples 373
Testing String Procedures 376
Summary 378
18 ASCII and BCD Arithmetic 379
Introduction 379
Processing in ASCII Representation 381
Our First Program 384
Processing Packed BCD Numbers 385
Illustrative Example 387
Decimal Versus Binary Arithmetic 389
Summary 390
19 Recursion 391
Introduction 391
Our First Program 392
Illustrative Examples 394
Recursion Versus Iteration 400
Summary 401
20 Protected-Mode Interrupt Processing 403
Introduction 403
A Taxonomy of Interrupts 404
Interrupt Processing in the Protected Mode 405
Exceptions 408
Software Interrupts 410
File I/O 411
Our First Program 415
Illustrative Examples 415
Hardware Interrupts 418
Direct Control of I/O Devices 419
Summary 420
21 High-Level Language Interface 423
Introduction 423
Calling Assembly Procedures from C 424
Our First Program 427
Illustrative Examples 428
Calling C Functions from Assembly . 432
Inline Assembly 434
Summary 441
22 Floating-Point Operations 443
Introduction 443
Floating-Point Unit Organization 444
Floating-Point Instructions 447
Our First Program 453
Illustrative Examples 455
Summary 458
APPENDICES 459
A Number Systems 461
Positional Number Systems 461
Conversion to Decimal 463
Conversion from Decimal 463
Binary/Octal/Hexadecimal Conversion 464
Unsigned Integers 466
Signed Integers 466
Floating-Point Representation 469
Summary 471
B Character Representation 473
Character Representation 473
ASCII Character Set 474
C Programming Exercises 477
D IA-32 Instruction Set 485
Instruction Format 485
Selected Instructions 487
E Glossary 517
Index 527

Assembly language - Wikipedia, the free encyclopedia
Introduction to Assembly Language - Swanson Technologies
Other Programming Language Books
Other Linux Books
Download

Wednesday, April 4, 2012

Eclipse Web Tools Platform, Developing Java (TM) Web Applications






Naci Dai
Lawrence Mandel
Arthur Ryman

Contents
Foreword xvii
Preface xix
Acknowledgments xxiii
About the Authors xxv
Part I ❍ Getting Started 1
Chapter 1 Introduction 3
Java Web Application Development and Eclipse 3
What This Book Contains 4
How This Book Is Organized 5
Source Code Examples 8
Introducing League Planet 9
Summary 10
Chapter 2 About the Eclipse Web Tools Platform Project 13
WTP Is Born 13
WTP Economics 15
Reducing Development Expense 16
Generating Revenue 19
The Structure of WTP 22
The Scope of WTP 23
WTP Subprojects 24
The Architecture of WTP 27
The WST Subproject 29
The JST Subproject 34
Contributing to WTP 37
Become a User 37
Monitor the Newsgroup 37
Report a Problem 38
Suggest an Improvement 38
Fix a Bug 39
Write an Article or Tutorial 39
Become a Committer 40
Grow the Community 40
Summary 40
Chapter 3 Quick Tour 41
Overview 41
Iteration 1: J2EE Web Applications 44
Add a Server Runtime Environment 46
Create a Dynamic Web Project 51
Create and Edit a JSP 56
Run the JSP on the Server 57
Summary of Iteration 1 60
Iteration 2: Servlets and Scriptlets 60
Add a Java Scriptlet to a JSP 60
Debug a JSP 61
Create a Servlet 64
Debug a Servlet 69
Summary of Iteration 2 70
Iteration 3: Database Access 71
Connect to a Database 72
Execute SQL Statements 75
Add Database Access to a Web Application 78
Summary of Iteration 3 82
Iteration 4: Web Services 82
Deploy a Web service 83
Use a Test Client 86
Monitor SOAP Messages 87
Summary of Iteration 4 88
Summary 88
Chapter 4 Setting Up Your Workspace 91
Installing and Updating WTP 91
The Installable Components of WTP 91
WTP Build Types 92
Installation via Update Manager 95
Installation via Zip Files 98
Installing Third-Party Content 100
JDK Setup 103
Verifying the Installation 103
Updating WTP 104
Configuring WTP 105
Data Preferences 107
Internet Preferences 107
Server Preferences 107
Validation Preferences 107
Web and XML Preferences 108
Web Services Preferences 108
XDoclet Preferences 109
Sharing Settings 110
Summary 110
Part II ❍ Java Web Application Development 111
Chapter 5 Web Application Architecture and Design 113
The Web Landscape 113
Web Applications 115
Java Web Applications 116
Layered Web Application Design 120
Model View Controller (MVC) for the Web 123
Java Application Frameworks 128
Service-Oriented Architecture (SOA) 130
Providing Services: The Service Layer 130
Case Study: League Planet 133
Summary 135
Chapter 6 Organizing Your Development Project 137
Web Project Types and J2EE Applications 138
Web Projects 139
J2EE Modules 140
Creating Applications 140
Creating EJB Applications 148
Creating Enterprise Applications 154
Advanced Web Projects 160
Modeling the Developer View 162
Example Projects 165
Basic Enterprise Application 165
Dividing a Web Module into Multiple Projects 171
Using Maven for Web Application Development 180
Summary 196
Chapter 7 The Presentation Tier 199
Introduction 199
Interaction Design 200
Graphic Design 203
The Structure of the Presentation Tier 204
Iteration 1: Static Web Projects, HTML, and the
Structured Source Editors 208
Static Web Projects 208
HTML 211
Structured Source Editors 218
Templates 221
Snippets 224
Summary of Iteration 1 230
Iteration 2: CSS 230
Summary of Iteration 2 234
Iteration 3: JavaScript 234
E-Mail Address Obfuscation 234
Data Entry Form Validation 236
Summary of Iteration 3 247
Iteration 4: XML and XSLT 248
XML 248
XSLT 252
Summary of Iteration 4 257
Iteration 5: DTD 257
Summary of Iteration 5 261
Iteration 6: Servers, Dynamic Web Projects,
and Servlets 261
Servers 261
Dynamic Web Projects 267
Servlets 270
Summary of Iteration 6 279
Iteration 7: JSP 279
Summary of Iteration 7 289
Iteration 8: Monitoring HTTP Sessions 289
HTTP Sessions 289
The TCP/IP Monitor 290
Viewing HTTP Sessions with the TCP/IP Monitor 291
Modifying and Resending a Message 293
Summary of Iteration 8 295
Summary 295
Chapter 8 The Business Logic Tier 297
A Common Business Tier Design 300
Iteration 1: The Domain Model 301
J2EE Utility Projects 301
The Object Model 304
The Service Layer 310
The Data Access Layer 315
Testing 320
Summary of Iteration 1 324
Iteration 2: Developing Session EJBs 325
Adding JBoss 329
XDoclet 332
EJB Projects 335
Creating Session Beans 339
Building a Web Client 349
Running the Application 352
Developing EJB 3.0 with WTP 356
Summary of Iteration 2 358
Iteration 3: Message-Driven Beans 358
A Brief Introduction to MDBs 358
Create an MDB 359
Add a Queue to JBoss 363
Create a JMS Web Client 363
Summary of Iteration 3 367
Summary 367
Chapter 9 The Persistence Tier 369
Designs for the Persistence Layer 370
Use JDBC APIs to Map Objects to a Database 371
Use Entity Beans to Map Objects to a Database 372
Use Object-Relational Frameworks to Map
Objects to a Database 373
Overview of Iterations 374
Iteration 1: Creating a Database 375
Summary of Iteration 1 385
Iteration 2: Data Layer 386
Summary of Iteration 2 391
Iteration 3: Entity Beans 392
Preparing JBoss, Derby, and XDoclet 393
Adding a CMP 396
Adding ejbCreate and finder Methods 401
Adding the Ice Hockey CMP Data Access Object 408
Testing the CMP Implementation 410
Developing JPA with WTP 414
Summary of Iteration 3 418
Summary 418
Chapter 10 Web Services 421
WSDL 422
SOAP 423
REST 424
REST Style Web Services 426
Overview of Iterations 427
Iteration 1: Developing Web Services Top-Down 428
XSD 429
WSDL 435
Deploying Web Services 440
Implementing the Web Service 446
Testing with the Web Services Explorer 451
Summary of Iteration 1 454
Iteration 2: Developing Web Services Bottom-Up 454
Develop the Java Service Implementation 455
Deploy the Service 460
Summary of Iteration 2 462
Iteration 3: Generating Web Service Client Proxies 464
Generate a Java Client Proxy and JSP Test Client 464
Using the JSP Test Client 468
Summary of Iteration 3 470
Iteration 4: Testing Web Services for Interoperability 470
Checking Messages for WS-I Compliance 471
Summary of Iteration 4 476
Iteration 5: Using Web Services in Web Applications 477
Generate the Query Web Service Client 477
Create the Servlets 478
Impot the User Interface Code 480
Test the User Interface 491
Summary of Iteration 5 494
Iteration 6: Discovering and Publishing Web Services 494
UDDI 495
WSIL 501
Summary of Iteration 6 508
Summary 508
Chapter 11 Testing 509
Automated Testing 511
Overview of Iterations 512
Iteration 1: Unit Testing with JUnit 512
Creating a Test Project 513
JUnit Test Case 515
JUnit Test Suite 518
Summary of Iteration 1 520
Iteration 2: Integration Testing with Cactus 520
Summary of Iteration 2 527
Iteration 3: System Testing with HttpUnit 528
Summary of Iteration 3 533
Iteration 4: Performance Testing with TPTP 533
Creating a Performance Test Project 536
HTTP Recording Test 536
Generating a Report 538
Summary of Iteration 4 539
Iteration 5: Profiling with TPTP 540
Summary of Iteration 5 545
Summary 546
Part III ❍ Extending WTP 549
Chapter 12 Adding New Servers 551
Overview of Adding a Generic Server Adapter 554
The GlassFish Server Runtime 554
Server Adapter Plug-ins 556
Adding Support for a New Server Runtime 558
Adding a New Server Type for a Runtime 561
Adding a New Runtime Target Handler 562
Facets and Runtime Components 563
Extending the Server Tools UI 565
The Generic Server Definition 566
Publishers 570
Testing the Server Adapter 573
Summary 580
Chapter 13 Supporting New File Types 583
Creating the DocBook Extension Plug-in 585
The DocBook Validator 585
The WTP Validation Framework 586
Implementing the DocBook Validator 587
Creating a Custom Marker Type 598
Declaring the DocBook Content Type 601
Summary 605
Chapter 14 Creating WSDL Extensions 607
Creating the WSDL Extension Plug-in 612
Extending the WSDL Editor 612
Customizing the Look of Extensibility
Elements in the Editor’s Design View 614
Adding Extensibility Elements to the Editor 617
Adding Custom Actions to the WSDL Editor
Design View 627
Extending WSDL Validation 635
Contributing to WSDL 1.1 Validation 636
Contributing Custom Validation Rules 640
Summary 644
Chapter 15 Customizing Resource Resolution 645
Creating the Resource Resolution Extension Plug-in 647
Contributing Resources to the XML Catalog 648
The XML Catalog 650
Adding a Single Resource to the XML Catalog 651
Adding a Catalog of Resources to the XML
Catalog 654
Implementing a Custom Resource Resolution Strategy 657
The URI Resolution Framework 659
Creating the Folder URI Resolver 661
Summary 665
Part IV ❍ Products and Plans 667
Chapter 16 Other Web Tools Based on Eclipse 669
Java Web Tools 669
BEA Workshop 670
CodeGear JBuilder 670
Exadel Studio 670
IBM Rational Application Developer for
WebSphere Software 670
JBoss IDE for Eclipse 671
MyEclipse 672
ObjectWeb Lomboz 672
SAP NetWeaver Developer Studio 672
W4T Eclipse 672
Perl Web Tools 674
EPIC 674
PHP Web Tools 674
Eclipse PHP Development Tools Project 674
PHPEclipse 674
Python Web Tools 675
PyDev 675
Ruby Web Tools 675
RadRails 675
Summary 675
Chapter 17 The Road Ahead 677
Eclipse Data Tools Platform (DTP) Project 678
Eclipse JavaServer Faces (JSF) Tools Project 678
Eclipse Dali Java Persistence Architecture (JPA)
Tools Project 679
Eclipse AJAX Tools Framework (ATF) Project 679
Java Enterprise Edition 5 679
Apache Axis2 and W3C WSDL 2.0 680
Eclipse PHP Development Tools Project 680
Eclipse SOA Tools Platform (STP) Project 681
Conclusion 681
Glossary 683
References 689
Index 697


Download Free Java Software, java.com: Java + You, Eclipse - The Eclipse Foundation open source community website, Eclipse (software) - Wikipedia, the free encyclopedia, java eclipse, java to com, javascript, java tutorial, ide for, how to java code, tutorial for java, the java tutorial

Eclipse Step-by-Step
Eclipse Cookbook
Other Java Books
Other Programming Language Books
Download

Wednesday, January 18, 2012

C-sharp 2.0 The Complete Reference, Second Edition






C# 2.0: The Complete Reference, Second Edition
byHerbert Schildt
McGraw-Hill/Osborne 2006 (912 pages)
ISBN:0072262095
With carefully crafted explanations, insider tips, and hundreds of examples, this book offers in-depth coverage of all aspects of C#, including its keywords, syntax, and core libraries.





Table of Contents
C# 2.0—The Complete Reference, Second Edition
Preface
Part I - The C# Language
Chapter 1 - The Creation of C#
Chapter 2 - An Overview of C#
Chapter 3 - Data Types, Literals, and Variables
Chapter 4 - Operators
Chapter 5 - Program Control Statements
Chapter 6 - Introducing Classes and Objects
Chapter 7 - Arrays and Strings
Chapter 8 - A Closer Look at Methods and Classes
Chapter 9 - Operator Overloading
Chapter 10 - Indexers and Properties
Chapter 11 - Inheritance
Chapter 12 - Interfaces, Structures, and Enumerations
Chapter 13 - Exception Handling
Chapter 14 - Using I/O
Chapter 15 - Delegates and Events
Chapter 16 - Namespaces, the Preprocessor, and Assemblies
Chapter 17 - Runtime Type ID, Reflection, and Attributes
Chapter 18 - Generics
Chapter 19 - Unsafe Code, Pointers, Nullable Types, and Miscellaneous Topics
Part II - Exploring the C# Library
Chapter 20 - Exploring the System Namespace
Chapter 21 - Strings and Formatting
Chapter 22 - Multithreaded Programming
Chapter 23 - Collections, Enumerators, and Iterators
Chapter 24 - Networking Through the Internet
Part III - Applying C#
Chapter 25 - Building Components
Chapter 26 - Creating Form-Based Windows Applications
Chapter 27 - A Recursive-Descent Expression Parser
Appendix A - XML Comment Quick Reference
Index
List of Figures
List of Tables


Other C# Books
Other Programming Language Books
Download

Tuesday, December 20, 2011

C++ The Complete Reference, 4th Edition






Herbert Schildt
McGraw-Hill/Osborne
New York Chicago San Francisco
Lisbon London Madrid Mexico City
Milan New Delhi San Juan
Seoul Singapore Sydney Toronto

Contents at a Glance
Part I The Foundation of C++: The C Subset
1 An Overview of C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4 Arrays and Null-Terminated Strings . . . . . . . . . . . . . . . . 89
5 Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
6 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
7 Structures, Unions, Enumerations,
and User-Defined Types . . . . . . . . . . . . . . . . . . . . . . . . 161
8 C-Style Console I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
9 File I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
10 The Preprocessor and Comments . . . . . . . . . . . . . . . . . . 237
Part II C++
11 An Overview of C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
12 Classes and Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
13 Arrays, Pointers, References, and the Dynamic
Allocation Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
14 Function Overloading, Copy Constructors,
and Default Arguments . . . . . . . . . . . . . . . . . . . . . . . . . 359
15 Operator Overloading . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
16 Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
17 Virtual Functions and Polymorphism . . . . . . . . . . . . . . . 443
18 Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
19 Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
20 The C++ I/O System Basics . . . . . . . . . . . . . . . . . . . . . . . 509
21 C++ File I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
22 Run-Time Type ID and the Casting Operators . . . . . . . 567
23 Namespaces, Conversion Functions,
and Other Advanced Topics . . . . . . . . . . . . . . . . . . . . . 591
24 Introducing the Standard Template Library . . . . . . . . . . 629
Part III The Standard Function Library
25 The C-Based I/O Functions . . . . . . . . . . . . . . . . . . . . . . . 699
26 The String and Character Functions . . . . . . . . . . . . . . . . 723
27 The Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . 737
28 Time, Date, and Localization Functions . . . . . . . . . . . . . 747
29 The Dynamic Allocation Functions . . . . . . . . . . . . . . . . . 757
30 Utility Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
31 The Wide-Character Functions . . . . . . . . . . . . . . . . . . . . . 775
Part IV The Standard C++ Class Library
32 The Standard C++ I/O Classes . . . . . . . . . . . . . . . . . . . . 787
33 The STL Container Classes . . . . . . . . . . . . . . . . . . . . . . . . 811
34 The STL Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
35 STL Iterators, Allocators, and Function Objects . . . . . . 861
36 The String Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
37 The Numeric Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 897
38 Exception Handling and Miscellaneous Classes . . . . . . 925
Part V Applying C++
39 Integrating New Classes: A Custom String Class . . . . . 935
40 Parsing Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963
A The .NET Managed Extensions to C++ . . . . . . . . . . . . . . 999
B C++ and the Robotics Age . . . . . . . . . . . . . . . . . . . . . . . . 1005
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1009

Another Programming Language Books
Another C++ Books
Download

C++ The Complete Reference, Third Edition






Herbert Schildt
Osborne McGraw-Hill
Berkeley New York St. Louis San Francisco
Auckland Bogotá Hamburg London Madrid
Mexico City Milan Montreal New Delhi Panama City
Paris São Paulo Singapore Sydney
Tokyo Toronto

Contents at a Glance
Part I The Foundation of C++: The C Subset
1 An Overview of C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4 Arrays and Null-Terminated Strings . . . . . . . . . . . . . . . . 89
5 Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
6 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
7 Structures, Unions, Enumerations, and User-
Defined Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
8 C-Style Console I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
9 File I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
10 The Preprocessor and Comments . . . . . . . . . . . . . . . . . . . 237
Part II C++
11 An Overview of C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
12 Classes and Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
13 Arrays, Pointers, References and the Dynamic
Allocation Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
14 Function Overloading, Copy Constructors,
and Default Arguments . . . . . . . . . . . . . . . . . . . . . . . . 361
15 Operator Overloading . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
16 Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
17 Virtual Functions and Polymorphism . . . . . . . . . . . . . . 445
18 Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
19 Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
20 C++ I/O System Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
21 C++ File I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
22 Run-Time Type ID and the Casting Operators . . . . . . . . 569
23 Namespaces, Conversion Functions,and Other
Advanced Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
24 Introducing the Standard Template Library . . . . . . . . . . 625
Part III The Standard Function Library
25 The C-Based I/O Functions . . . . . . . . . . . . . . . . . . . . . . . . 695
26 The String and Character Functions . . . . . . . . . . . . . . . . . 719
27 The Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . . 733
28 Time, Date, and Localization Functions . . . . . . . . . . . . . . 743
29 The Dynamic Allocation Functions . . . . . . . . . . . . . . . . . . 753
30 Utility Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
31 The Wide-Character Functions . . . . . . . . . . . . . . . . . . . . . 771
Part IV The Standard C++ Class Library
32 The Standard C++ I/O Classes . . . . . . . . . . . . . . . . . . . . . 783
33 The STL Container Classes . . . . . . . . . . . . . . . . . . . . . . . . . 807
34 The STL Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
35 STL Iterators, Allocators, and Function Objects . . . . . . . 857
36 The String Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877
37 The Numeric Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 893
38 Exception Handling and Miscellaneous Classes . . . . . . . 921
Part V Applying C++
39 Integrating New Classes: A Custom String Class . . . . . . 931
40 An Object-Oriented Expression Parser . . . . . . . . . . . . . . . 959
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 995


Another C++ Books
Another Programming Language Books
Download

Monday, December 19, 2011

C++ How to Program, Fifth Edition






By H. M. Deitel - Deitel & Associates, Inc., P. J. Deitel - Deitel & Associates, Inc.
Publisher : Prentice Hall
Pub Date : January 05, 2005
Print ISBN-10 : 0-13-185757-6
eText ISBN-10 : 0-13-186103-4
Print ISBN-13 : 978-0-13-185757-5
eText ISBN-13 : 978-0-13-186103-9
Pages : 1536

Best-selling C++ text significantly revised to include new early objects coverage and new streamlined case studies.

Copyright iv
Deitel® Books, Cyber Classrooms, Complete Training Courses and Web-Based Training Courses published by Prentice Hall ii
Preface xxiii
Features of C++ How to Program, 5/e xxiii
Teaching Approach xxvii
Tour of the Book xxxi
Object-Oriented Design of an ATM with the UML: A Tour of the Optional Software Engineering Case Study xliv
Software Bundled with C++ How to Program, 5/e xlvi
Teaching Resources for C++ How to Program, 5/e xlix
C++ Multimedia Cyber Classroom, 5/e, Online xlix
C++ in the Lab xlix
CourseCompassSM, WebCT™ and Blackboard™ li
PearsonChoices lii
The Deitel® Buzz Online Free E-mail Newsletter liii
Acknowledgments liii
About the Authors lvi
About Deitel & Associates, Inc. lvii
Before You Begin lix
Resources on the CD That Accompanies C++ How to Program, Fifth Edition lix
Copying and Organizing Files lix
Copying the Book Examples from the CD lx
Changing the Read-Only Property of Files lx
Chapter 1. Introduction to Computers, the Internet and World Wide Web 1
Section 1.1. Introduction 2
Section 1.2. What Is a Computer? 3
Section 1.3. Computer Organization 4
Section 1.4. Early Operating Systems 5
Section 1.5. Personal, Distributed and Client/Server Computing 5
Section 1.6. The Internet and the World Wide Web 6
Section 1.7. Machine Languages, Assembly Languages and High-Level Languages 6
Section 1.8. History of C and C++ 8
Section 1.9. C++ Standard Library 8
Section 1.10. History of Java 9
Section 1.11. FORTRAN, COBOL, Pascal and Ada 10
Section 1.12. Basic, Visual Basic, Visual C++, C# and .NET 11
Section 1.13. Key Software Trend: Object Technology 11
Section 1.14. Typical C++ Development Environment 12
Section 1.15. Notes About C++ and C++ How to Program, 5/e 15
Section 1.16. Test-Driving a C++ Application 16
Section 1.17. Software Engineering Case Study: Introduction to Object Technology and the UML (Required) 22
Section 1.18. Wrap-Up 27
Section 1.19. Web Resources 27
Summary 29
Terminology 31
Self-Review Exercises 33
Answers to Self-Review Exercises 34
Exercises 34
Chapter 2. Introduction to C++ Programming 36
Section 2.1. Introduction 37
Section 2.2. First Program in C++: Printing a Line of Text 37
Section 2.3. Modifying Our First C++ Program 41
Section 2.4. Another C++ Program: Adding Integers 42
Section 2.5. Memory Concepts 46
Section 2.6. Arithmetic 48
Section 2.7. Decision Making: Equality and Relational Operators 51
Section 2.8. (Optional) Software Engineering Case Study: Examining the ATM Requirements Document 56
Section 2.9. Wrap-Up 65
Summary 65
Terminology 67
Self-Review Exercises 68
Answers to Self-Review Exercises 69
Exercises 70
Chapter 3. Introduction to Classes and Objects 74
Section 3.1. Introduction 75
Section 3.2. Classes, Objects, Member Functions and Data Members 75
Section 3.3. Overview of the Chapter Examples 77
Section 3.4. Defining a Class with a Member Function 77
Section 3.5. Defining a Member Function with a Parameter 81
Section 3.6. Data Members, set Functions and get Functions 84
Section 3.7. Initializing Objects with Constructors 91
Section 3.8. Placing a Class in a Separate File for Reusability 95
Section 3.9. Separating Interface from Implementation 99
Section 3.10. Validating Data with set Functions 105
Section 3.11. (Optional) Software Engineering Case Study: Identifying the Classes in the ATM Requirements Document 110
Section 3.12. Wrap-Up 118
Summary 118
Terminology 121
Self-Review Exercises 121
Answers to Self-Review Exercises 122
Exercises 122

Chapter 4. Control Statements: Part 1 124
Section 4.1. Introduction 125
Section 4.2. Algorithms 125
Section 4.3. Pseudocode 126
Section 4.4. Control Structures 127
Section 4.5. if Selection Statement 131
Section 4.6. if...else Double-Selection Statement 132
Section 4.7. while Repetition Statement 137
Section 4.8. Formulating Algorithms: Counter-Controlled Repetition 139
Section 4.9. Formulating Algorithms: Sentinel-Controlled Repetition 145
Section 4.10. Formulating Algorithms: Nested Control Statements 156
Section 4.11. Assignment Operators 161
Section 4.12. Increment and Decrement Operators 161
Section 4.13. (Optional) Software Engineering Case Study: Identifying Class Attributes in the ATM System 165
Section 4.14. Wrap-Up 169
Summary 170
Terminology 172
Self-Review Exercises 173
Answers to Self-Review Exercises 174
Exercises 177
Chapter 5. Control Statements: Part 2 185
Section 5.1. Introduction 186
Section 5.2. Essentials of Counter-Controlled Repetition 186
Section 5.3. for Repetition Statement 188
Section 5.4. Examples Using the for Statement 193
Section 5.5. do...while Repetition Statement 197
Section 5.6. switch Multiple-Selection Statement 199
Section 5.7. break and continue Statements 209
Section 5.8. Logical Operators 211
Section 5.9. Confusing Equality (==) and Assignment (=) Operators 216
Section 5.10. Structured Programming Summary 217
Section 5.11. (Optional) Software Engineering Case Study: Identifying Objects' States and Activities in the ATM System 222
Section 5.12. Wrap-Up 226
Summary 228
Terminology 230
Self-Review Exercises 230
Answers to Self-Review Exercises 231
Exercises 233
Chapter 6. Functions and an Introduction to Recursion 238
Section 6.1. Introduction 239
Section 6.2. Program Components in C++ 240
Section 6.3. Math Library Functions 241
Section 6.4. Function Definitions with Multiple Parameters 243
Section 6.5. Function Prototypes and Argument Coercion 248
Section 6.6. C++ Standard Library Header Files 250
Section 6.7. Case Study: Random Number Generation 252
Section 6.8. Case Study: Game of Chance and Introducing enum 258
Section 6.9. Storage Classes 262
Section 6.10. Scope Rules 265
Section 6.11. Function Call Stack and Activation Records 268
Section 6.12. Functions with Empty Parameter Lists 272
Section 6.13. Inline Functions 273
Section 6.14. References and Reference Parameters 275
Section 6.15. Default Arguments 280
Section 6.16. Unary Scope Resolution Operator 282
Section 6.17. Function Overloading 283
Section 6.18. Function Templates 286
Section 6.19. Recursion 288
Section 6.20. Example Using Recursion: Fibonacci Series 292
Section 6.21. Recursion vs. Iteration 295
Section 6.22. (Optional) Software Engineering Case Study: Identifying Class Operations in the ATM System 298
Section 6.23. Wrap-Up 305
Summary 306
Terminology 309
Self-Review Exercises 311
Answers to Self-Review Exercises 313
Exercises 316
Chapter 7. Arrays and Vectors 326
Section 7.1. Introduction 327
Section 7.2. Arrays 328
Section 7.3. Declaring Arrays 329
Section 7.4. Examples Using Arrays 330
Section 7.5. Passing Arrays to Functions 346
Section 7.6. Case Study: Class GradeBook Using an Array to Store Grades 351
Section 7.7. Searching Arrays with Linear Search 358
Section 7.8. Sorting Arrays with Insertion Sort 359
Section 7.9. Multidimensional Arrays 362
Section 7.10. Case Study: Class GradeBook Using a Two-Dimensional Array 365
Section 7.11. Introduction to C++ Standard Library Class Template vector 372
Section 7.12. (Optional) Software Engineering Case Study: Collaboration Among Objects in the ATM System 377
Section 7.13. Wrap-Up 385
Summary 385
Terminology 387
Self-Review Exercises 388
Answers to Self-Review Exercises 389
Exercises 390
Recursion Exercises 400
vector Exercises 400
Chapter 8. Pointers and Pointer-Based Strings 401
Section 8.1. Introduction 402
Section 8.2. Pointer Variable Declarations and Initialization 403
Section 8.3. Pointer Operators 404
Section 8.4. Passing Arguments to Functions by Reference with Pointers 407
Section 8.5. Using const with Pointers 411
Section 8.6. Selection Sort Using Pass-by-Reference 418
Section 8.7. sizeof Operators 421
Section 8.8. Pointer Expressions and Pointer Arithmetic 424
Section 8.9. Relationship Between Pointers and Arrays 427
Section 8.10. Arrays of Pointers 431
Section 8.11. Case Study: Card Shuffling and Dealing Simulation 432
Section 8.12. Function Pointers 438
Section 8.13. Introduction to Pointer-Based String Processing 443
Section 8.14. Wrap-Up 454
Summary 455
Terminology 456
Self-Review Exercises 457
Answers to Self-Review Exercises 459
Exercises 461
Special Section: Building Your Own Computer 464
More Pointer Exercises 469
String-Manipulation Exercises 474
Special Section: Advanced String-Manipulation Exercises 475
A Challenging String-Manipulation Project 479
Chapter 9. Classes: A Deeper Look, Part 1 480
Section 9.1. Introduction 481
Section 9.2. Time Class Case Study 482
Section 9.3. Class Scope and Accessing Class Members 487
Section 9.4. Separating Interface from Implementation 489
Section 9.5. Access Functions and Utility Functions 491
Section 9.6. Time Class Case Study: Constructors with Default Arguments 493
Section 9.7. Destructors 499
Section 9.8. When Constructors and Destructors Are Called 500
Section 9.9. Time Class Case Study: A Subtle TrapReturning a Reference to a private Data Member 503
Section 9.10. Default Memberwise Assignment 506
Section 9.11. Software Reusability 508
Section 9.12. (Optional) Software Engineering Case Study: Starting to Program the Classes of the ATM System 509
Section 9.13. Wrap-Up 516
Summary 517
Terminology 519
Self-Review Exercises 519
Answers to Self-Review Exercises 520
Exercises 520
Chapter 10. Classes: A Deeper Look, Part 2 523
Section 10.1. Introduction 524
Section 10.2. const (Constant) Objects and const Member Functions 524
Section 10.3. Composition: Objects as Members of Classes 534
Section 10.4. friend Functions and friend Classes 541
Section 10.5. Using the this Pointer 545
Section 10.6. Dynamic Memory Management with Operators new and delete 550
Section 10.7. static Class Members 552
Section 10.8. Data Abstraction and Information Hiding 558
Section 10.9. Container Classes and Iterators 561
Section 10.10. Proxy Classes 562
Section 10.11. Wrap-Up 565
Summary 566
Terminology 567
Self-Review Exercises 568
Answers to Self-Review Exercises 569
Exercises 569
Chapter 11. Operator Overloading; String and Array Objects 571
Section 11.1. Introduction 572
Section 11.2. Fundamentals of Operator Overloading 573
Section 11.3. Restrictions on Operator Overloading 574
Section 11.4. Operator Functions as Class Members vs. Global Functions 576
Section 11.5. Overloading Stream Insertion and Stream Extraction Operators 577
Section 11.6. Overloading Unary Operators 581
Section 11.7. Overloading Binary Operators 581
Section 11.8. Case Study: Array Class 582
Section 11.9. Converting between Types 594
Section 11.10. Case Study: String Class 595
Section 11.11. Overloading ++ and -- 607
Section 11.12. Case Study: A Date Class 609
Section 11.13. Standard Library Class string 613
Section 11.14. explicit Constructors 617
Section 11.15. Wrap-Up 621
Summary 621
Terminology 624
Self-Review Exercises 624
Answers to Self-Review Exercises 625
Exercises 625
Chapter 12. Object-Oriented Programming: Inheritance 633
Section 12.1. Introduction 634
Section 12.2. Base Classes and Derived Classes 635
Section 12.3. protected Members 638
Section 12.4. Relationship between Base Classes and Derived Classes 638
Section 12.5. Constructors and Destructors in Derived Classes 670
Section 12.6. public, protected and private Inheritance 678
Section 12.7. Software Engineering with Inheritance 678
Section 12.8. Wrap-Up 680
Summary 681
Terminology 682
Self-Review Exercises 682
Answers to Self-Review Exercises 683
Exercises 683
Chapter 13. Object-Oriented Programming: Polymorphism 686
Section 13.1. Introduction 687
Section 13.2. Polymorphism Examples 689
Section 13.3. Relationships Among Objects in an Inheritance Hierarchy 690
Section 13.4. Type Fields and switch Statements 707
Section 13.5. Abstract Classes and Pure virtual Functions 708
Section 13.6. Case Study: Payroll System Using Polymorphism 710
Section 13.7. (Optional) Polymorphism, Virtual Functions and Dynamic Binding "Under the Hood" 728
Section 13.8. Case Study: Payroll System Using Polymorphism and Run-Time Type Information with Downcasting, dynamic_cast, typeid and type_info 732
Section 13.9. Virtual Destructors 735
Section 13.10. (Optional) Software Engineering Case Study: Incorporating Inheritance into the ATM System 736
Section 13.11. Wrap-Up 744
Summary 744
Terminology 746
Self-Review Exercises 746
Answers to Self-Review Exercises 747
Exercises 747
Chapter 14. Templates 749
Section 14.1. Introduction 750
Section 14.2. Function Templates 751
Section 14.3. Overloading Function Templates 754
Section 14.4. Class Templates 754
Section 14.5. Nontype Parameters and Default Types for Class Templates 761
Section 14.6. Notes on Templates and Inheritance 762
Section 14.7. Notes on Templates and Friends 762
Section 14.8. Notes on Templates and static Members 763
Section 14.9. Wrap-Up 764
Summary 764
Terminology 765
Self-Review Exercises 766
Answers to Self-Review Exercises 766
Exercises 766
Chapter 15. Stream Input/Output 769
Section 15.1. Introduction 770
Section 15.2. Streams 771
Section 15.3. Stream Output 775
Section 15.4. Stream Input 776
Section 15.5. Unformatted I/O using read, write and gcount 780
Section 15.6. Introduction to Stream Manipulators 781
Section 15.7. Stream Format States and Stream Manipulators 787
Section 15.8. Stream Error States 797
Section 15.9. Tying an Output Stream to an Input Stream 800
Section 15.10. Wrap-Up 800
Summary 800
Terminology 803
Self-Review Exercises 804
Answers to Self-Review Exercises 806
Exercises 808
Chapter 16. Exception Handling 810
Section 16.1. Introduction 811
Section 16.2. Exception-Handling Overview 812
Section 16.3. Example: Handling an Attempt to Divide by Zero 812
Section 16.4. When to Use Exception Handling 819
Section 16.5. Rethrowing an Exception 820
Section 16.6. Exception Specifications 821
Section 16.7. Processing Unexpected Exceptions 822
Section 16.8. Stack Unwinding 823
Section 16.9. Constructors, Destructors and Exception Handling 824
Section 16.10. Exceptions and Inheritance 825
Section 16.11. Processing new Failures 825
Section 16.12. Class auto_ptr and Dynamic Memory Allocation 829
Section 16.13. Standard Library Exception Hierarchy 832
Section 16.14. Other Error-Handling Techniques 834
Section 16.15. Wrap-Up 834
Summary 835
Terminology 837
Self-Review Exercises 838
Answers to Self-Review Exercises 838
Exercises 839
Chapter 17. File Processing 841
Section 17.1. Introduction 842
Section 17.2. The Data Hierarchy 842
Section 17.3. Files and Streams 844
Section 17.4. Creating a Sequential File 845
Section 17.5. Reading Data from a Sequential File 849
Section 17.6. Updating Sequential Files 856
Section 17.7. Random-Access Files 856
Section 17.8. Creating a Random-Access File 857
Section 17.9. Writing Data Randomly to a Random-Access File 862
Section 17.10. Reading from a Random-Access File Sequentially 864
Section 17.11. Case Study: A Transaction-Processing Program 867
Section 17.12. Input/Output of Objects 874
Section 17.13. Wrap-Up 874
Summary 874
Terminology 876
Self-Review Exercises 876
Answers to Self-Review Exercises 877
Exercises 878
Chapter 18. Class string and String Stream Processing 883
Section 18.1. Introduction 884
Section 18.2. string Assignment and Concatenation 885
Section 18.3. Comparing strings 887
Section 18.4. Substrings 890
Section 18.5. Swapping strings 891
Section 18.6. string Characteristics 892
Section 18.7. Finding Strings and Characters in a string 894
Section 18.8. Replacing Characters in a string 896
Section 18.9. Inserting Characters into a string 898
Section 18.10. Conversion to C-Style Pointer-Based char * Strings 899
Section 18.11. Iterators 901
Section 18.12. String Stream Processing 902
Section 18.13. Wrap-Up 905
Summary 906
Terminology 907
Self-Review Exercises 907
Answers to Self-Review Exercises 908
Exercises 908
Chapter 19. Web Programming 911
Section 19.1. Introduction 912
Section 19.2. HTTP Request Types 913
Section 19.3. Multitier Architecture 914
Section 19.4. Accessing Web Servers 915
Section 19.5. Apache HTTP Server 916
Section 19.6. Requesting XHTML Documents 917
Section 19.7. Introduction to CGI 917
Section 19.8. Simple HTTP Transactions 918
Section 19.9. Simple CGI Scripts 920
Section 19.10. Sending Input to a CGI Script 928
Section 19.11. Using XHTML Forms to Send Input 928
Section 19.12. Other Headers 938
Section 19.13. Case Study: An Interactive Web Page 939
Section 19.14. Cookies 943
Section 19.15. Server-Side Files 949
Section 19.16. Case Study: Shopping Cart 954
Section 19.17. Wrap-Up 969
Section 19.18. Internet and Web Resources 969
Summary 970
Terminology 972
Self-Review Exercises 973
Answers to Self-Review Exercises 973
Exercises 974
Chapter 20. Searching and Sorting 975
Section 20.1. Introduction 976
Section 20.2. Searching Algorithms 976
Section 20.3. Sorting Algorithms 982
Section 20.4. Wrap-Up 992
Summary 992
Terminology 994
Self-Review Exercises 994
Answers to Self-Review Exercises 995
Exercises 995
Chapter 21. Data Structures 998
Section 21.1. Introduction 999
Section 21.2. Self-Referential Classes 1000
Section 21.3. Dynamic Memory Allocation and Data Structures 1001
Section 21.4. Linked Lists 1001
Section 21.5. Stacks 1016
Section 21.6. Queues 1021
Section 21.7. Trees 1025
Section 21.8. Wrap-Up 1033
Summary 1034
Terminology 1035
Self-Review Exercises 1036
Answers to Self-Review Exercises 1037
Exercises 1038
Special Section: Building Your Own Compiler 1043
Chapter 22. Bits, Characters, C-Strings and structs 1057
Section 22.1. Introduction 1058
Section 22.2. Structure Definitions 1058
Section 22.3. Initializing Structures 1061
Section 22.4. Using Structures with Functions 1061
Section 22.5. typedef 1061
Section 22.6. Example: High-Performance Card Shuffling and Dealing Simulation 1062
Section 22.7. Bitwise Operators 1065
Section 22.8. Bit Fields 1074
Section 22.9. Character-Handling Library 1078
Section 22.10. Pointer-Based String-Conversion Functions 1084
Section 22.11. Search Functions of the Pointer-Based String-Handling Library 1089
Section 22.12. Memory Functions of the Pointer-Based String-Handling Library 1094
Section 22.13. Wrap-Up 1099
Summary 1099
Terminology 1101
Self-Review Exercises 1102
Answers to Self-Review Exercises 1103
Exercises 1104
Chapter 23. Standard Template Library (STL) 1110
Section 23.1. Introduction to the Standard Template Library (STL) 1112
Section 23.2. Sequence Containers 1124
Section 23.3. Associative Containers 1138
Section 23.4. Container Adapters 1147
Section 23.5. Algorithms 1152
Section 23.6. Class bitset 1183
Section 23.7. Function Objects 1187
Section 23.8. Wrap-Up 1190
Section 23.9. STL Internet and Web Resources 1191
Summary 1192
Terminology 1196
Self-Review Exercises 1197
Answers to Self-Review Exercises 1198
Exercises 1198
Recommended Reading 1199
Chapter 24. Other Topics 1200
Section 24.1. Introduction 1201
Section 24.2. const_cast Operator 1201
Section 24.3. namespaces 1203
Section 24.4. Operator Keywords 1207
Section 24.5. mutable Class Members 1209
Section 24.6. Pointers to Class Members (.* and ->*) 1211
Section 24.7. Multiple Inheritance 1213
Section 24.8. Multiple Inheritance and virtual Base Classes 1218
Section 24.9. Wrap-Up 1222
Section 24.10. Closing Remarks 1223
Summary 1223
Terminology 1225
Self-Review Exercises 1225
Answers to Self-Review Exercises 1226
Exercises 1226
Appendix A. Operator Precedence and Associativity Chart 1228
Section A.1. Operator Precedence 1228
Appendix B. ASCII Character Set 1231
Appendix C. Fundamental Types 1232
Appendix D. Number Systems 1234
Section D.1. Introduction 1235
Section D.2. Abbreviating Binary Numbers as Octal and Hexadecimal Numbers 1238
Section D.3. Converting Octal and Hexadecimal Numbers to Binary Numbers 1239
Section D.4. Converting from Binary, Octal or Hexadecimal to Decimal 1239
Section D.5. Converting from Decimal to Binary, Octal or Hexadecimal 1240
Section D.6. Negative Binary Numbers: Two's Complement Notation 1242
Summary 1243
Terminology 1243
Self-Review Exercises 1244
Answers to Self-Review Exercises 1245
Exercises 1246
Appendix E. C Legacy Code Topics 1247
Section E.1. Introduction 1248
Section E.2. Redirecting Input/Output on UNIX/LINUX/Mac OS X and Windows Systems 1248
Section E.3. Variable-Length Argument Lists 1249
Section E.4. Using Command-Line Arguments 1252
Section E.5. Notes on Compiling Multiple-Source-File Programs 1253
Section E.6. Program Termination with exit and atexit 1255
Section E.7. The volatile Type Qualifier 1257
Section E.8. Suffixes for Integer and Floating-Point Constants 1257
Section E.9. Signal Handling 1257
Section E.10. Dynamic Memory Allocation with calloc and realloc 1260
Section E.11. The Unconditional Branch: goto 1261
Section E.12. Unions 1262
Section E.13. Linkage Specifications 1265
Section E.14. Wrap-Up 1266
Summary 1267
Terminology 1269
Self-Review Exercises 1269
Answers to Self-Review Exercises 1270
Exercises 1270
Appendix F. Preprocessor 1272
Section F.1. Introduction 1273
Section F.2. The #include Preprocessor Directive 1273
Section F.3. The #define Preprocessor Directive: Symbolic Constants 1274
Section F.4. The #define Preprocessor Directive: Macros 1275
Section F.5. Conditional Compilation 1277
Section F.6. The #error and #pragma Preprocessor Directives 1278
Section F.7. The # and ## Operators 1278
Section F.8. Predefined Symbolic Constants 1279
Section F.9. Assertions 1279
Section F.10. Wrap-Up 1280
Summary 1280
Terminology 1281
Self-Review Exercises 1281
Answers to Self-Review Exercises 1282
Exercises 1283
Appendix G. ATM Case Study Code 1285
Section G.1. ATM Case Study Implementation 1285
Section G.2. Class ATM 1286
Section G.3. Class Screen 1293
Section G.4. Class Keypad 1294
Section G.5. Class CashDispenser 1295
Section G.6. Class DepositSlot 1297
Section G.7. Class Account 1298
Section G.8. Class BankDatabase 1300
Section G.9. Class Transaction 1304
Section G.10. Class BalanceInquiry 1306
Section G.11. Class Withdrawal 1308
Section G.12. Class Deposit 1313
Section G.13. Test Program ATMCaseStudy.cpp 1316
Section G.14. Wrap-Up 1317
Appendix H. UML 2: Additional Diagram Types 1318
Section H.1. Introduction 1318
Section H.2. Additional Diagram Types 1318
Appendix I. C++ Internet and Web Resources 1320
Section I.1. Resources 1320
Section I.2. Tutorials 1322
Section I.3. FAQs 1322
Section I.4. Visual C++ 1322
Section I.5. Newsgroups 1323
Section I.6. Compilers and Development Tools 1323
Section I.7. Standard Template Library 1324
Appendix J. Introduction to XHTML 1325
Section J.1. Introduction 1326
Section J.2. Editing XHTML 1326
Section J.3. First XHTML Example 1327
Section J.4. Headers 1330
Section J.5. Linking 1331
Section J.6. Images 1333
Section J.7. Special Characters and More Line Breaks 1338
Section J.8. Unordered Lists 1340
Section J.9. Nested and Ordered Lists 1340
Section J.10. Basic XHTML Tables 1341
Section J.11. Intermediate XHTML Tables and Formatting 1346
Section J.12. Basic XHTML Forms 1349
Section J.13. More Complex XHTML Forms 1352
Section J.14. Internet and World Wide Web Resources 1359
Summary 1359
Terminology 1361
Appendix K. XHTML Special Characters 1363
Appendix L. Using the Visual Studio .NET Debugger 1364
Section L.1. Introduction 1365
Section L.2. Breakpoints and the Continue Command 1365
Section L.3. The Locals and Watch Windows 1371
Section L.4. Controlling Execution Using the Step Into, Step Over, Step Out and Continue Commands 1374
Section L.5. The Autos Window 1377
Section L.6. Wrap-Up 1378
Summary 1379
Terminology 1380
Self-Review Exercises 1380
Answers to Self-Review Exercises 1380
Appendix M. Using the GNU C++ Debugger 1381
Section M.1. Introduction 1382
Section M.2. Breakpoints and the run, stop, continue and print Commands 1382
Section M.3. The print and set Commands 1389
Section M.4. Controlling Execution Using the step, finish and next Commands 1391
Section M.5. The watch Command 1393
Section M.6. Wrap-Up 1396
Summary 1397
Terminology 1398
Self-Review Exercises 1398
Answers to Self-Review Exercises 1398
Bibliography 1399
End User License Agreements EULA-1
Prentice Hall License Agreement and Limited Warranty EULA-1
License Agreement and Limited Warranty EULA-3
Using the CD-ROM EULA-3
Contents of the CD-ROM EULA-3
Software and Hardware System Requirements EULA-3
Index


Another C++ Books
Another Programming Language Books
Download

C++ GUI Programming with Qt.3






Contents
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
A Brief History of Qt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Part I: Basic Qt
1. Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Hello Qt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Making Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Using the Reference Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2. Creating Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Subclassing QDialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Signals and Slots in Depth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Rapid Dialog Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Shape-Changing Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Dynamic Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Built-in Widget and Dialog Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3. Creating Main Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Subclassing QMainWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Creating Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Implementing the File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Setting Up the Status Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Using Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Storing Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Multiple Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Splash Screens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4. Implementing Application Functionality . . . . . . . . . . . . . . . . . . . . 69
The Central Widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Subclassing QTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Loading and Saving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Implementing the Edit Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Implementing the Other Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Subclassing QTableItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5. Creating Custom Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Customizing Qt Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Subclassing QWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Integrating Custom Widgets with Qt Designer . . . . . . . . . . . . . . . . 108
Double Buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Part II: Intermediate Qt
6. Layout Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Basic Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Splitters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Widget Stacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Scroll Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Dock Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Multiple Document Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
7. Event Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Reimplementing Event Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Installing Event Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Staying Responsive During Intensive Processing . . . . . . . . . . . . . . 171
8. 2D and 3D Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Painting with QPainter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Graphics with QCanvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Graphics with OpenGL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
9. Drag and Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Enabling Drag and Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Supporting Custom Drag Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Advanced Clipboard Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
10. Input/Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Reading and Writing Binary Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Reading and Writing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Handling Files and Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Inter-Process Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
11. Container Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Pointer-Based Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
QString and QVariant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
12. Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Connecting and Querying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Presenting Data in Tabular Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Creating Data-Aware Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
13. Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Using QFtp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Using QHttp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
TCP Networking with QSocket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
UDP Networking with QSocketDevice . . . . . . . . . . . . . . . . . . . . . . . . 301
14. XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Reading XML with SAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Reading XML with DOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Writing XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
15. Internationalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Working with Unicode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Making Applications Translation-Aware . . . . . . . . . . . . . . . . . . . . . . 323
Dynamic Language Switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Translating Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
16. Providing Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Tooltips, Status Tips, and “What’s This?” Help . . . . . . . . . . . . . . . . . 339
Using QTextBrowser as a Simple Help Engine . . . . . . . . . . . . . . . . 342
Using Qt Assistant for Powerful Online Help . . . . . . . . . . . . . . . . . . 346
17. Multithreading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Working with Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Communicating with the GUI Thread . . . . . . . . . . . . . . . . . . . . . . . . 359
Using Qt’s Classes in Non-GUI Threads . . . . . . . . . . . . . . . . . . . . . . . 363
18. Platform-Specific Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Interfacing with Native APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Using ActiveX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Session Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Appendices
A. Installing Qt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
A Note on Licensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Installing Qt/Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Installing Qt/Mac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Installing Qt/X11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
B. Qt’s Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403

Another Programming Language Books
Another C++ Books
Download

Saturday, December 17, 2011

C++ for Programmers






C++ for Programmers: Deitel® Developer Series
by Paul J. Deitel - Deitel & Associates, Inc.; Harvey M. Deitel - Deitel & Associates, Inc.

--------------------------------------------------------------------------------

Publisher: Prentice Hall
Pub Date: January 23, 2009
Print ISBN-10: 0-13-700130-4
Print ISBN-13: 978-0-13-700130-9
Web ISBN-10: 0-13-701849-5
Web ISBN-13: 978-0-13-701849-9

Pages: 1056


Overview

PRACTICAL, EXAMPLE-RICH COVERAGE OF:


Classes, Objects, Encapsulation, Inheritance, Polymorphism

Integrated OOP Case Studies: Time, GradeBook, Employee

Industrial-Strength, 95-Page OOD/UML® 2 ATM Case Study

Standard Template Library (STL): Containers, Iterators and Algorithms

I/O, Types, Control Statements, Functions

Arrays, Vectors, Pointers, References

String Class, C-Style Strings

Operator Overloading, Templates

Exception Handling, Files

Bit and Character Manipulation

Boost Libraries and the Future of C++

GNU™ and Visual C++® Debuggers

And more…



Another C++ Books
Another Programming Language Books
Download CHM or Download PDF

C# 3.0 The Complete Reference






Contents at a Glance
Part I The C# Language
1 The Creation of C# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 An Overview of C# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3 Data Types, Literals, and Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
5 Program Control Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
6 Introducing Classes and Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
7 Arrays and Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
8 A Closer Look at Methods and Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
9 Operator Overloading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
10 Indexers and Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
11 Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
12 Interfaces, Structures, and Enumerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
13 Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
14 Using I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
15 Delegates, Events, and Lambda Expressions . . . . . . . . . . . . . . . . . . . . . . . . . 399
16 Namespaces, the Preprocessor, and Assemblies . . . . . . . . . . . . . . . . . . . . . . 437
17 Runtime Type ID, Refl ection, and Attributes . . . . . . . . . . . . . . . . . . . . . . . . 459
18 Generics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
19 LINQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
20 Unsafe Code, Pointers, Nullable Types, and Miscellaneous Topics . . . . . 585
Part II Exploring the C# Library
21 Exploring the System Namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
22 Strings and Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
23 Multithreaded Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
24 Collections, Enumerators, and Iterators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
25 Networking Through the Internet Using System.Net . . . . . . . . . . . . . . . . . 821
26 Use System.Windows.Forms to Create Form-Based Windows
Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
A Documentation Comment Quick Reference . . . . . . . . . . . . . . . . . . . . . . . . . 867
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871

Another C# Books
Another Programming Language Books
Download

C# 2.0 The Complete Reference






By Herbert Schildt
Publisher: McGraw-Hill Osborne Media
This comprehensive volume is fully updated for C# 2.0 -- the newest version of Microsoft's revolutionary programming language.The changes found in C# 2.0 bring Java-like power to millions of Windows programmers worldwide. With expertly crafted explanations, insider tips, and hundreds of examples, this book fully explains every aspect of C# 2.0. Written in the clear, uncompromising style that has made master programming author Herb Schildt the choice of millions, the book covers all the new and existing features of this major programming language.
Subjects



Part I - The C# Language

Chapter 1 The Creation of C#

Chapter 2 An Overview of C#

Chapter 3 Data Types, Literals, and Variables

Chapter 4 Operators

Chapter 5 Program Control Statements

Chapter 6 Introducing Classes and Objects

Chapter 7 Arrays and Strings

Chapter 8 A Closer Look at Methods and Classes

Chapter 9 Operator Overloading

Chapter 10 Indexers and Properties

Chapter 11 Inheritance

Chapter 12 Interfaces, Structures, and Enumerations

Chapter 13 Exception Handling

Chapter 14 Using I/O

Chapter 15 Delegates and Events

Chapter 16 Namespaces, the Preprocessor, and Assemblies

Chapter 17 Runtime Type ID, Reflection, and Attributes

Chapter 18 Generics

Chapter 19 Unsafe Code, Pointers, Nullable Types, and Miscellaneous Topics

Part II - Exploring the C# Library

Chapter 20 Exploring the System Namespace

Chapter 21 Strings and Formatting

Chapter 22 Multithreaded Programming

Chapter 23 Collections, Enumerators, and Iterators

Chapter 24 Networking Through the Internet

Part III - Applying

Chapter 25 Building Components

Chapter 26 Creating Form-Based Windows Applications

Chapter 27 A Recursive-Descent Expression Parser

Another C# Books
Another Programming Language Books
Download

Thursday, December 15, 2011

C# How To Program






Contents
Contents viii
Illustrations xix
Preface xxxviii
1 Introduction to Computers, the Internet,
the Web and C# 1
1.1 Introduction 2
1.2 What Is a Computer? 3
1.3 Computer Organization 3
1.4 Evolution of Operating Systems 4
1.5 Personal Computing, Distributed Computing and Client/Server Computing 5
1.6 Machine Languages, Assembly Languages and High-level Languages 6
1.7 C, C++, Visual Basic .NET and Java™ 7
1.8 C# 9
1.9 Other High-level Languages 10
1.10 Structured Programming 10
1.11 Key Software Trend: Object Technology 11
1.12 Hardware Trends 13
1.13 History of the Internet and World Wide Web 13
1.14 World Wide Web Consortium (W3C) 15
1.15 Extensible Markup Language (XML) 15
1.16 Introduction to Microsoft .NET 16
1.17 .NET Framework and the Common Language Runtime 18
1.18 Tour of the Book 20
1.19 Internet and World Wide Web Resources 29Contents IX
2 Introduction to the Visual Studio .NET IDE 33
2.1 Introduction 34
2.2 Visual Studio .NET Integrated Development Environment (IDE) Overview 34
2.3 Menu Bar and Toolbar 37
2.4 Visual Studio .NET Windows 39
2.4.1 Solution Explorer 39
2.4.2 Toolbox 40
2.4.3 Properties Window 42
2.5 Using Help 42
2.6 Simple Program: Displaying Text and an Image 44
3 Introduction to C# Programming 59
3.1 Introduction 60
3.2 Simple Program: Printing a Line of Text 60
3.3 Another Simple Program: Adding Integers 71
3.4 Memory Concepts 75
3.5 Arithmetic 76
3.6 Decision Making: Equality and Relational Operators 80
4 Control Structures: Part 1 94
4.1 Introduction 95
4.2 Algorithms 95
4.3 Pseudocode 96
4.4 Control Structures 96
4.5 if Selection Structure 99
4.6 if/else Selection Structure 100
4.7 while Repetition Structure 105
4.8 Formulating Algorithms: Case Study 1 (Counter-Controlled Repetition) 106
4.9 Formulating Algorithms with Top-Down, Stepwise Refinement:
Case Study 2 (Sentinel-Controlled Repetition) 109
4.10 Formulating Algorithms with Top-Down, Stepwise Refinement:
Case Study 3 (Nested Control Structures) 116
4.11 Assignment Operators 120
4.12 Increment and Decrement Operators 121
4.13 Introduction to Windows Application Programming 124
5 Control Structures: Part 2 139
5.1 Introduction 140
5.2 Essentials of Counter-Controlled Repetition 140
5.3 for Repetition Structure 142
5.4 Examples Using the for Structure 146
5.5 switch Multiple-Selection Structure 152
5.6 do/while Repetition Structure 156
5.7 Statements break and continue 158
5.8 Logical and Conditional Operators 160
5.9 Structured-Programming Summary 166X Contents
6 Methods 178
6.1 Introduction 179
6.2 Program Modules in C# 179
6.3 Math Class Methods 181
6.4 Methods 181
6.5 Method Definitions 183
6.6 Argument Promotion 193
6.7 C# Namespaces 195
6.8 Value Types and Reference Types 196
6.9 Passing Arguments: Pass-by-Value vs. Pass-by-Reference 197
6.10 Random-Number Generation 200
6.11 Example: Game of Chance 207
6.12 Duration of Variables 212
6.13 Scope Rules 212
6.14 Recursion 215
6.15 Example Using Recursion: The Fibonacci Series 219
6.16 Recursion vs. Iteration 222
6.17 Method Overloading 223
7 Arrays 236
7.1 Introduction 237
7.2 Arrays 237
7.3 Declaring and Allocating Arrays 239
7.4 Examples Using Arrays 240
7.4.1 Allocating an Array and Initializing Its Elements 240
7.4.2 Totaling the Elements of an Array 242
7.4.3 Using Histograms to Display Array Data Graphically 243
7.4.4 Using the Elements of an Array as Counters 244
7.4.5 Using Arrays to Analyze Survey Results 247
7.5 Passing Arrays to Methods 250
7.6 Passing Arrays by Value and by Reference 253
7.7 Sorting Arrays 257
7.8 Searching Arrays: Linear Search and Binary Search 260
7.8.1 Searching an Array with Linear Search 260
7.8.2 Searching a Sorted Array with Binary Search 261
7.9 Multiple-Subscripted Arrays 265
7.10 foreach Repetition Structure 272
8 Object-Based Programming 280
8.1 Introduction 281
8.2 Implementing a Time Abstract Data Type with a Class 282
8.3 Class Scope 290
8.4 Controlling Access to Members 290
8.5 Initializing Class Objects: Constructors 292
8.6 Using Overloaded Constructors 293
8.7 Properties 297
8.8 Composition: Objects References as Instance Variables of Other Classes 306
8.9 Using the this Reference 309
8.10 Garbage Collection 311
8.11 static Class Members 312
8.12 const and readonly Members 317
8.13 Indexers 319
8.14 Data Abstraction and Information Hiding 326
8.15 Software Reusability 327
8.16 Namespaces and Assemblies 328
8.17 Class View and Object Browser 333
9 Object-Oriented Programming: Inheritance 342
9.1 Introduction 343
9.2 Base Classes and Derived Classes 344
9.3 protected and internal Members 347
9.4 Relationship between Base Classes and Derived Classes 347
9.5 Case Study: Three-Level Inheritance Hierarchy 368
9.6 Constructors and Destructors in Derived Classes 371
9.7 Software Engineering with Inheritance 377
10 Object-Oriented Programming: Polymorphism 382
10.1 Introduction 383
10.2 Derived-Class-Object to Base-Class-Object Conversion 383
10.3 Type Fields and switch Statements 390
10.4 Polymorphism Examples 391
10.5 Abstract Classes and Methods 392
10.6 Case Study: Inheriting Interface and Implementation 394
10.7 sealed Classes and Methods 402
10.8 Case Study: Payroll System Using Polymorphism 403
10.9 Case Study: Creating and Using Interfaces 413
10.10 Delegates 425
10.11 Operator Overloading 430
11 Exception Handling 438
11.1 Introduction 439
11.2 Exception Handling Overview 440
11.3 Example: DivideByZeroException 443
11.4 .NET Exception Hierarchy 448
11.5 finally Block 449
11.6 Exception Properties 457
11.7 Programmer-Defined Exception Classes 462
11.8 Handling Overflows with Operators checked and unchecked 466
12 Graphical User Interface Concepts: Part 1 474
12.1 Introduction 475
12.2 Windows Forms 476
12.3 Event-Handling Model 479
12.3.1 Basic Event Handling 480
12.4 Control Properties and Layout 484
12.5 Labels, TextBoxes and Buttons 488
12.6 GroupBoxes and Panels 495
12.7 CheckBoxes and RadioButtons 498
12.8 PictureBoxes 507
12.9 Mouse Event Handling 509
12.10 Keyboard Event Handling 511
13 Graphical User Interfaces Concepts:
Part 2 520
13.1 Introduction 521
13.2 Menus 521
13.3 LinkLabels 530
13.4 ListBoxes and CheckedListBoxes 534
13.4.1 ListBoxes 537
13.4.2 CheckedListBoxes 539
13.5 ComboBoxes 542
13.6 TreeViews 547
13.7 ListViews 553
13.8 Tab Control 560
13.9 Multiple-Document-Interface (MDI) Windows 565
13.10 Visual Inheritance 574
13.11 User-Defined Controls 578
14 Multithreading 590
14.1 Introduction 591
14.2 Thread States: Life Cycle of a Thread 592
14.3 Thread Priorities and Thread Scheduling 594
14.4 Thread Synchronization and Class Monitor 599
14.5 Producer/Consumer Relationship without Thread Synchronization 601
14.6 Producer/Consumer Relationship with Thread Synchronization 607
14.7 Producer/Consumer Relationship: Circular Buffer 616
15 Strings, Characters and Regular Expressions 632
15.1 Introduction 633
15.2 Fundamentals of Characters and Strings 633
15.3 String Constructors 635
15.4 String Indexer, Length Property and CopyTo Method 636
15.5 Comparing Strings 638
15.6 String Method GetHashCode 642
15.7 Locating Characters and Substrings in Strings 643
15.8 Extracting Substrings from Strings 646
15.9 Concatenating Strings 647
15.10 Miscellaneous String Methods 648
15.11 Class StringBuilder 650
15.12 StringBuilder Indexer, Length and Capacity Properties,
and EnsureCapacity Method 652
15.13 StringBuilder Append and AppendFormat Methods 654
15.14 StringBuilder Insert, Remove and Replace Methods 658
15.15 Char Methods 661
15.16 Card Shuffling and Dealing Simulation 664
15.17 Regular Expressions and Class Regex 668
16 Graphics and Multimedia 684
16.1 Introduction 685
16.2 Graphics Contexts and Graphics Objects 687
16.3 Color Control 688
16.4 Font Control 696
16.5 Drawing Lines, Rectangles and Ovals 701
16.6 Drawing Arcs 704
16.7 Drawing Polygons and Polyli]nes 707
16.8 Advanced Graphics Capabilities 711
16.9 Introduction to Multimedia 717
16.10 Loading, Displaying and Scaling Images 718
16.11 Animating a Series of Images 720
16.12 Windows Media Player 733
16.13 Microsoft Agent 736
17 Files and Streams 757 6
17.1 Introduction 757
17.2 Data Hierarchy 757
17.3 Files and Streams 759
17.4 Classes File and Directory 761
17.5 Creating a Sequential-Access File 771
17.6 Reading Data from a Sequential-Access File 783
17.7 Random-Access Files 794
17.8 Creating a Random-Access File 798
17.9 Writing Data Randomly to a Random-Access File 802
17.10 Reading Data Sequentially from a Random-Access File 807
17.11 Case Study: A Transaction-Processing Program 812
18 Extensible Markup Language (XML) 838
18.1 Introduction 839
18.2 XML Documents 839
18.3 XML Namespaces 844
18.4 Document Object Model (DOM) 847
18.5 Document Type Definitions (DTDs), Schemas and Validation 865
18.5.1 Document Type Definitions 866
18.5.2 Microsoft XML Schemas 869
18.5.3 W3C XML Schema 872
18.5.4 Schema Validation in C# 873
18.6 Extensible Stylesheet Language and XslTransform 877
18.7 Microsoft BizTalk™ 884
18.8 Internet and World Wide Web Resources 887
19 Database, SQL and
ADO .NET 895
19.1 Introduction 896
19.2 Relational Database Model 897
19.3 Relational Database Overview: Books Database 898
19.4 Structured Query Language (SQL) 905
19.4.1 Basic SELECT Query 905
19.4.2 WHERE Clause 906
19.4.3 ORDER BY Clause 909
19.4.4 Merging Data from Multiple Tables: INNER JOIN 912
19.4.5 Joining Data from Tables Authors, AuthorISBN,
Titles and Publishers 914
19.4.6 INSERT Statement 917
19.4.7 UPDATE Statement 918
19.4.8 DELETE Statement 919
19.5 ADO .NET Object Model 920
19.6 Programming with ADO .NET: Extracting Information from a DBMS 921
19.6.1 Connecting to and Querying an Access Data Source 921
19.6.2 Querying the Books Database 928
19.7 Programming with ADO.NET: Modifying a DBMS 930
19.8 Reading and Writing XML Files 938
20 ASP .NET, Web Forms and Web Controls 948
20.1 Introduction 949
20.2 Simple HTTP Transaction 950
20.3 System Architecture 952
20.4 Creating and Running a Simple Web Form Example 953
20.5 Web Controls 966
20.5.1 Text and Graphics Controls 967
20.5.2 AdRotator Control 971
20.5.3 Validation Controls 976
20.6 Session Tracking 987
20.6.1 Cookies 988
20.6.2 Session Tracking with HttpSessionState 997
20.7 Case Study: Online Guest Book 1006
20.8 Case Study: Connecting to a Database in ASP .NET 1013
20.9 Tracing 1027
20.10 Internet and World Wide Web Resources 1030
21 ASP .NET and Web Services 1039
21.1 Introduction 1040
21.2 Web Services 1041
21.3 Simple Object Access Protocol (SOAP) and Web Services 1044
21.4 Publishing and Consuming Web Services 1046
21.5 Session Tracking in Web Services 1062
21.6 Using Web Forms and Web Services 1075
21.7 Case Study: Temperature Information Application 1081
21.8 User-Defined Types in Web Services 1091
22 Networking: Streams-Based Sockets and Datagrams1106
22.1 Introduction 1107
22.2 Establishing a Simple Server (Using Stream Sockets) 1108
22.3 Establishing a Simple Client (Using Stream Sockets) 1110
22.4 Client/Server Interaction with Stream-Socket Connections 1111
22.5 Connectionless Client/Server Interaction with Datagrams 1120
22.6 Client/Server Tic-Tac-Toe Using a Multithreaded Server 1125
23 Data Structures and Collections 1145
23.1 Introduction 1146
23.2 Self-Referential Classes 1146
23.3 Linked Lists 1148
23.4 Stacks 1160
23.5 Queues 1165
23.6 Trees 1168
23.6.1 Binary Search Tree of Integer Values 1170
23.6.2 Binary Search Tree of IComparable Objects 1177
23.7 Collection Classes 1185
23.7.1 Class Array 1185
23.7.2 Class ArrayList 1188
23.7.3 Class Stack 1194
23.7.4 Class Hashtable 1198
24 Accessibility 1212
24.1 Introduction 1213
24.2 Regulations and Resources 1214
24.3 Web Accessibility Initiative 1216
24.4 Providing Alternatives for Images 1216
24.5 Maximizing Readability by Focusing on Structure 1218
24.6 Accessibility in Visual Studio .NET 1218
24.6.1 Enlarging Toolbar Icons 1219
24.6.2 Enlarging the Text 1220
24.6.3 Modifying the Toolbox 1221
24.6.4 Modifying the Keyboard 1221
24.6.5 Rearranging Windows 1222
24.7 Accessibility in C# 1224
24.8 Accessibility in XHTML Tables 1230
24.9 Accessibility in XHTML Frames 1234
24.10 Accessibility in XML 1235
24.11 Using Voice Synthesis and Recognition with VoiceXML™ 1235
24.12 CallXML™ 1243
24.13 JAWS® for Windows 1248
24.14 Other Accessibility Tools 1249
24.15 Accessibility in Microsoft® Windows® 2000 1251
24.15.1 Tools for People with Visual Impairments 1252
24.15.2 Tools for People with Hearing Impairments 1254
24.15.3 Tools for Users Who Have Difficulty Using the Keyboard 1255
24.15.4 Microsoft Narrator 1258
24.15.5 Microsoft On-Screen Keyboard 1261
24.15.6 Accessibility Features in Microsoft Internet Explorer 5.5 1262
24.16 Internet and World Wide Web Resources 1264
A Operator Precedence Chart 1273
B Number Systems (on CD) 1275
B.1 Introduction 1276
B.2 Abbreviating Binary Numbers as Octal Numbers and
Hexadecimal Numbers 1279
B.3 Converting Octal Numbers and Hexadecimal Numbers
to Binary Numbers 1281
B.4 Converting from Binary, Octal or Hexadecimal to Decimal 1281
B.5 Converting from Decimal to Binary, Octal, or Hexadecimal 1282
B.6 Negative Binary Numbers: Two’s Complement Notation 1283
C Career Opportunities (on CD) 1289
C.1 Introduction 1290
C.2 Resources for the Job Seeker 1291
C.3 Online Opportunities for Employers 1292
C.4 Recruiting Services 1297
C.5 Career Sites 1298
C.6 Internet and World Wide Web Resources 1303
D Visual Studio .NET Debugger 1311
D.1 Introduction 1312
D.2 Breakpoints 1313
D.3 Examining Data 1315
D.4 Program Control 1318
D.5 Additional Method Debugging Capabilities 1322
D.6 Additional Class Debugging Capabilities 1324
E Generating Documentation in Visual Studio (on CD) 1329
E.1 Introduction 1330
E.2 Documentation Comments 1330
E.3 Documenting C# Source Code 1331
E.4 Creating Comment Web Pages 1339
E.5 Creating XML Documentation Files 1341
F ASCII Character Set 1348
G Unicode® (on CD) 1349
G.1 Introduction 1350
G.2 Unicode Transformation Formats 1351
G.3 Characters and Glyphs 1352
G.4 Advantages and Disadvantages of Unicode 1353
G.5 Unicode Consortium’s Web Site 1353
G.6 Using Unicode 1355
G.7 Character Ranges 1357
H COM Integration (on CD) 1362
H.1 Introduction 1362
H.2 ActiveX Integration 1364
H.3 DLL Integration 1367
H.4 Internet and World Wide Web Resources 1371
I Introduction to HyperText Markup Language 4:
Part 1 (on CD) 1374
I.1 Introduction 1375
I.2 Markup Languages 1375
I.3 Editing HTML 1376
I.4 Common Elements 1376
I.5 Headers 1379
I.6 Linking 1380
I.7 Images 1382
I.8 Special Characters and More Line Breaks 1386
I.9 Unordered Lists 1388
I.10 Nested and Ordered Lists 1389
I.11 Internet and World Wide Web Resources 1392
J Introduction to HyperText Markup Language 4:
Part 2 (on CD) 1397
J.1 Introduction 1398
J.2 Basic HTML Tables 1398
J.3 Intermediate HTML Tables and Formatting 1400
J.4 Basic HTML Forms 1403
J.5 More Complex HTML Forms 1406
J.6 Internal Linking 1413
J.7 Creating and Using Image Maps 1416
J.8 Tags 1418
J.9 frameset Element 1420
J.10 Nested framesets 1422
J.11 Internet and World Wide Web Resources 1424
K Introduction to XHTML: Part 1 (on CD) 1430
K.1 Introduction 1431
K.2 Editing XHTML 1431
K.3 First XHTML Example 1432
K.4 W3C XHTML Validation Service 1435
K.5 Headers 1436
K.6 Linking 1438
K.7 Images 1441
K.8 Special Characters and More Line Breaks 1445
K.9 Unordered Lists 1447
K.10 Nested and Ordered Lists 1448
K.11 Internet and World Wide Web Resources 1451
L Introduction to XHTML: Part 2 (on CD) 1456
L.1 Introduction 1457
L.2 Basic XHTML Tables 1457
L.3 Intermediate XHTML Tables and Formatting 1460
L.4 Basic XHTML Forms 1462
L.5 More Complex XHTML Forms 1465
L.6 Internal Linking 1473
L.7 Creating and Using Image Maps 1476
L.8 meta Elements 1478
L.9 frameset Element 1479
L.10 Nested framesets 1483
L.11 Internet and World Wide Web Resources 1485
M HTML/XHTML Special Characters 1491
N HTML/XHTML Colors 1492
O Bit Manipulation (on CD) 1495
O.1 Introduction 1496
O.2 Bit Manipulation and the Bitwise Operators 1496
O.3 Class BitArray 1508
P Crystal Reports® for Visual Studio .NET 1513
P.1 Introduction 1513
P.2 Crystal Reports Web Site Resources 1513
P.3 Crystal Reports and Visual Studio .NET 1514
Bibliography 1518
Index 1522

Another C# Books
Another Programming Language Books
Download
Related Posts with Thumbnails

Put Your Ads Here!