Muutke küpsiste eelistusi

E-raamat: Ivor Horton's Beginning Visual Cplusplus 2010 [Wiley Online]

  • Formaat: 1272 pages, ill, Contains 1 Digital online
  • Ilmumisaeg: 12-Apr-2010
  • Kirjastus: Wrox Press
  • ISBN-10: 1118983947
  • ISBN-13: 9781118983942
  • Wiley Online
  • Hind: 58,14 €*
  • * hind, mis tagab piiramatu üheaegsete kasutajate arvuga ligipääsu piiramatuks ajaks
  • Formaat: 1272 pages, ill, Contains 1 Digital online
  • Ilmumisaeg: 12-Apr-2010
  • Kirjastus: Wrox Press
  • ISBN-10: 1118983947
  • ISBN-13: 9781118983942
The leading author of programming tutorials for beginners introduces you to Visual C++ 2010

Ivor Horton is the preeminent author of introductory programming language tutorials; previous editions of his Beginning Visual C++ have sold nearly 100,000 copies. This book is a comprehensive introduction to both the Standard C++ language and to Visual C++ 2010; no previous programming experience is required.

All aspects of the 2010 release are covered, including changes to the language and the C++ standard..

  • Microsoft Visual C++ is one of the most popular C++ development environments and compilers, used by hundreds of thousands of developers
  • Ivor Horton's approach to programming tutorials has achieved a huge following; this book gives beginning programmers a comprehensive introduction to both Standard C++ and Visual C++ 2010
  • Covers all the language changes in Visual C++ 2010, library additions, new MFC features, changes in the Visual Studio development environment, and more
  • Also includes a brief introduction to programming for multicore processors in native C++ and C++/CLR processors
  • Nearly 100,000 copies of this book have been sold in previous editions

Beginners seeking a complete education in Visual C++ will find everything they need in Ivor Horton's Beginning Visual C++ 2010.

Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file.

Introduction xxxiii
Programming with Visual C++2010
1(34)
The .NET Framework
2(1)
The Common Language Runtime
2(1)
Writing C++ Applications
3(2)
Learning Windows Programming
5(4)
Learning C++
5(1)
The C++ Standards
5(1)
Attributes
6(1)
Console Applications
6(1)
Windows Programming Concepts
7(2)
What Is the Integrated Development Environment?
9(1)
The Editor
9(1)
The Compiler
10(1)
The Linker
10(1)
The Libraries
10(1)
Using the IDE
10(22)
Toolbar Options
12(1)
Dockable Toolbars
12(1)
Documentation
13(1)
Projects and Solutions
13(14)
Setting Options in Visual C++ 2010
27(1)
Creating and Executing Windows Applications
28(3)
Creating a Windows Forms Application
31(1)
Summary
32(3)
Data, Variables, and Calculations
35(86)
The Structure of a C++ Program
36(13)
The main() Function
44(1)
Program Statements
44(2)
Whitespace
46(1)
Statement Blocks
47(1)
Automatically Generated Console Programs
47(2)
Defining Variables
49(3)
Naming Variables
49(1)
Declaring Variables
50(1)
Initial Values for Variables
51(1)
Fundamental Data Types
52(9)
Integer Variables
52(1)
Character Data Types
53(2)
Integer Type Modifiers
55(1)
The Boolean Type
56(2)
Floating-Point Types
58(1)
Literals
59(1)
Defining Synonyms for Data Types
59(1)
Variables with Specific Sets of Values
59(2)
Basic Input/Output Operations
61(5)
Input from the Keyboard
61(1)
Output to the Command Line
62(1)
Formatting the Output
63(1)
Escape Sequences
64(2)
Calculating in C++
66(12)
The Assignment Statement
66(1)
Arithmetic Operations
67(5)
Calculating a Remainder
72(1)
Modifying a Variable
73(1)
The Increment and Decrement Operators
74(2)
The Sequence of Calculation
76(2)
Type Conversion and Casting
78(3)
Type Conversion in Assignments
79(1)
Explicit Type Conversion
79(1)
Old-Style Casts
80(1)
The Auto Keyword
81(1)
Discovering Types
81(1)
The Bitwise Operators
82(6)
The Bitwise AND
82(2)
The Bitwise OR
84(1)
The Bitwise Exclusive OR
85(1)
The Bitwise NOT
86(1)
The Bitwise Shift Operators
86(2)
Introducing Lvalues and Rvalues
88(1)
Understanding Storage Duration and Scope
89(7)
Automatic Variables
89(3)
Positioning Variable Declarations
92(1)
Global Variables
92(4)
Static Variables
96(1)
Namespaces
96(4)
Declaring a Namespace
97(2)
Multiple Namespaces
99(1)
C++/CLI Programming
100(16)
C++/CLI Specific: Fundamental Data Types
101(4)
C++/CLI Output to the Command Line
105(1)
C++/CLI Specific---Formatting the Output
106(3)
C++/CLI Input from the Keyboard
109(1)
Using safe_cast
110(1)
C++/CLI Enumerations
111(5)
Discovering C++/CLI Types
116(1)
Summary
116(5)
Decisions and Loops
121(46)
Comparing Values
121(18)
The if Statement
123(1)
Nested if Statements
124(4)
Nested if-else statements
128(2)
Logical Operators and Expressions
130(3)
The Conditional Operator
133(2)
The switch Statement
135(4)
Unconditional Branching
139(1)
Repeating a Block of Statements
139(18)
What Is a Loop?
139(3)
Variations on the for Loop
142(8)
The while Loop
150(2)
The do-while Loop
152(2)
Nested Loops
154(3)
C++/CLI Programming
157(6)
The for each Loop
161(2)
Summary
163(4)
Arrays, Strings, and Pointers
167(84)
Handling Multiple Data Values of the Same Type
168(12)
Arrays
168(1)
Declaring Arrays
169(3)
Initializing Arrays
172(2)
Character Arrays and String Handling
174(3)
Multidimensional Arrays
177(3)
Indirect Data Access
180(21)
What Is a Pointer?
181(1)
Declaring Pointers
181(1)
Using Pointers
182(1)
Initializing Pointers
183(7)
The sizeof Operator
190(2)
Constant Pointers and Pointers to Constants
192(2)
Pointers and Arrays
194(7)
Dynamic Memory Allocation
201(5)
The Free Store, Alias the Heap
201(1)
The new and delete Operators
202(1)
Allocating Memory Dynamically for Arrays
203(3)
Dynamic Allocation of Multidimensional Arrays
206(1)
Using References
206(2)
What Is a Reference?
207(1)
Declaring and Initializing Lvalue References
207(1)
Defining and Initializing Rvalue References
208(1)
Native C++ Library Functions for Strings
208(7)
Finding the Length of a Null-Terminated String
209(1)
Joining Null-Terminated Strings
210(1)
Copying Null-Terminated Strings
211(1)
Comparing Null-Terminated Strings
212(1)
Searching Null-Terminated Strings
213(2)
C++/CLI Programming
215(32)
Tracking Handles
216(1)
CLR Arrays
217(16)
Strings
233(11)
Tracking References
244(1)
Interior Pointers
244(3)
Summary
247(4)
Introducing Structure into Your Programs
251(44)
Understanding Functions
252(7)
Why Do You Need Functions?
253(1)
Structure of a Function
253(3)
Using a Function
256(3)
Passing Arguments to a Function
259(18)
The Pass-by-value Mechanism
260(2)
Pointers as Arguments to a Function
262(1)
Passing Arrays to a Function
263(4)
References as Arguments to a Function
267(3)
Use of the const Modifier
270(1)
Rvalue Reference Parameters
271(2)
Arguments to main()
273(2)
Accepting a Variable Number of Function Arguments
275(2)
Returning Values from a Function
277(8)
Returning a Pointer
277(3)
Returning a Reference
280(3)
Static Variables in a Function
283(2)
Recursive Function Calls
285(4)
Using Recursion
288(1)
C++/CLI Programming
289(3)
Functions Accepting a Variable Number of Arguments
289(1)
Arguments to main()
290(2)
Summary
292(3)
More About Program Structure
295(58)
Pointers to Functions
295(7)
Declaring Pointers to Functions
296(3)
A Pointer to a Function as an Argument
299(2)
Arrays of Pointers to Functions
301(1)
Initializing Function Parameters
302(1)
Exceptions
303(5)
Throwing Exceptions
305(1)
Catching Exceptions
306(1)
Exception Handling in the MFC
307(1)
Handling Memory Allocation Errors
308(2)
Function Overloading
310(4)
What Is Function Overloading?
310(3)
Reference Types and Overload Selection
313(1)
When to Overload Functions
313(1)
Function Templates
314(3)
Using a Function Template
314(3)
Using the decltype Operator
317(1)
An Example Using Functions
318(18)
Implementing a Calculator
319(3)
Eliminating Blanks from a String
322(1)
Evaluating an Expression
322(3)
Getting the Value of a Term
325(1)
Analyzing a Number
326(4)
Putting the Program Together
330(1)
Extending the Program
331(2)
Extracting a Substring
333(3)
Running the Modified Program
336(1)
C++/CLI Programming
336(13)
Understanding Generic Functions
337(6)
A Calculator Program for the CLR
343(6)
Summary
349(4)
Defining Your Own Data Types
353(82)
The struct in C++
354(9)
What Is a struct?
354(1)
Defining a struct
354(1)
Initializing a struct
355(1)
Accessing the Members of a struct
355(4)
IntelliSense Assistance with Structures
359(1)
The struct RECT
360(1)
Using Pointers with a struct
361(2)
Data Types, Objects, Classes, and Instances
363(3)
First Class
364(1)
Operations on Classes
364(1)
Terminology
365(1)
Understanding Classes
366(8)
Defining a Class
366(1)
Declaring Objects of a Class
367(1)
Accessing the Data Members of a Class
367(3)
Member Functions of a Class
370(2)
Positioning a Member Function Definition
372(1)
Inline Functions
372(2)
Class Constructors
374(8)
What Is a Constructor?
374(2)
The Default Constructor
376(2)
Assigning Default Parameter Values in a Class
378(3)
Using an Initialization List in a Constructor
381(1)
Making a Constructor Explicit
381(1)
Private Members of a Class
382(8)
Accessing private Class Members
385(1)
The friend Functions of a Class
386(2)
The Default Copy Constructor
388(2)
The Pointer this
390(3)
Const Objects
393(2)
Const Member Functions of a Class
393(1)
Member Function Definitions Outside the Class
394(1)
Arrays of Objects
395(2)
Static Members of a Class
397(4)
Static Data Members
397(1)
Static Function Members of a Class
397(4)
Pointers and References to Class Objects
401(5)
Pointers to Objects
401(3)
References to Class Objects
404(2)
C++/CLI Programming
406(26)
Defining Value Class Types
407(5)
Defining Reference Class Types
412(3)
Defining a Copy Constructor for a Reference Class Type
415(1)
Class Properties
416(13)
Initonly Fields
429(2)
Static Constructors
431(1)
Summary
432(3)
More on Classes
435(114)
Class Destructors
435(7)
What Is a Destructor?
436(1)
The Default Destructor
436(2)
Destructors and Dynamic Memory Allocation
438(4)
Implementing a Copy Constructor
442(2)
Sharing Memory Between Variables
444(2)
Defining Unions
444(2)
Anonymous Unions
446(1)
Unions in Classes and Structures
446(1)
Operator Overloading
446(20)
Implementing an Overloaded Operator
447(3)
Implementing Full Support for a Comparison Operator
450(4)
Overloading the Assignment Operator
454(5)
Overloading the Addition Operator
459(4)
Overloading the Increment and Decrement Operators
463(2)
Overloading the Function Call Operator
465(1)
The Object Copying Problem
466(11)
Avoiding Unnecessary Copy Operations
466(4)
Applying Rvalue Reference Parameters
470(2)
Named Objects are Lvalues
472(5)
Class Templates
477(9)
Defining a Class Template
478(3)
Creating Objects from a Class Template
481(2)
Class Templates with Multiple Parameters
483(3)
Templates for Function Objects
486(1)
Using Classes
486(22)
The Idea of a Class Interface
486(1)
Defining the Problem
487(1)
Implementing the CBox Class
487(21)
Organizing Your Program Code
508(2)
Naming Program Files
509(1)
Native C++ Library Classes for Strings
510(23)
Creating String Objects
510(2)
Concatenating Strings
512(4)
Accessing and Modifying Strings
516(4)
Comparing Strings
520(3)
Searching Strings
523(10)
C++/CLI Programming
533(11)
Overloading Operators in Value Classes
534(6)
Overloading the Increment and Decrement Operators
540(1)
Overloading Operators in Reference Classes
540(3)
Implementing the Assignment Operator for Reference Types
543(1)
Summary
544(5)
Class Inheritance and Virtual Functions
549(96)
Object-Oriented Programming Basics
549(2)
Inheritance in Classes
551(4)
What Is a Base Class?
551(1)
Deriving Classes from a Base Class
552(3)
Access Control Under Inheritance
555(11)
Constructor Operation in a Derived Class
558(4)
Declaring Protected Class Members
562(3)
The Access Level of Inherited Class Members
565(1)
The Copy Constructor in a Derived Class
566(3)
Class Members as Friends
569(3)
Friend Classes
571(1)
Limitations on Class Friendship
572(1)
Virtual Functions
572(18)
What is a Virtual Function?
574(2)
Using Pointers to Class Objects
576(2)
Using References with Virtual Functions
578(2)
Pure Virtual Functions
580(1)
Abstract Classes
581(3)
Indirect Base Classes
584(2)
Virtual Destructors
586(4)
Casting Between Class Types
590(1)
Nested Classes
590(4)
C++/CLI Programming
594(44)
Boxing and Unboxing
594(1)
Inheritance in C++/CLI Classes
595(7)
Interface Classes
602(1)
Defining Interface Classes
602(4)
Classes and Assemblies
606(5)
Functions Specified as new
611(1)
Delegates and Events
612(13)
Destructors and Finalizers in Reference Classes
625(3)
Generic Classes
628(10)
Summary
638(7)
The Standard Template Library
645(110)
What is the Standard Template Library?
645(6)
Containers
646(1)
Container Adapters
647(1)
Iterators
648(1)
Algorithms
649(1)
Function Objects in the STL
650(1)
Function Adapters
650(1)
The Range of STL Containers
651(1)
Sequence Containers
651(50)
Creating Vector Containers
652(3)
The Capacity and Size of a Vector Container
655(5)
Accessing the Elements in a Vector
660(1)
Inserting and Deleting Elements in a Vector
661(2)
Storing Class Objects in a Vector
663(5)
Sorting Vector Elements
668(1)
Storing Pointers in a Vector
669(2)
Double-Ended Queue Containers
671(4)
Using List Containers
675(10)
Using Other Sequence Containers
685(16)
Associative Containers
701(14)
Using Map Containers
702(12)
Using a Multimap Container
714(1)
More on Iterators
715(8)
Using Input Stream Iterators
715(4)
Using Inserter Iterators
719(1)
Using Output Stream Iterators
720(3)
More on Function Objects
723(1)
More on Algorithms
724(3)
fill()
725(1)
replace()
725(1)
find()
725(1)
transform()
726(1)
Lambda Expressions
727(9)
The Capture Clause
728(2)
Capturing Specific Variables
730(1)
Templates and Lambda Expressions
730(4)
Wrapping a Lambda Expression
734(2)
The STL for C++/CLI Programs
736(16)
STL-CLR Containers
737(1)
Using Sequence Containers
737(8)
Using Associative Containers
745(7)
Lambda Expressions in C++/CLI
752(1)
Summary
752(3)
Debugging Techniques
755(52)
Understanding Debugging
756(3)
Program Bugs
757(1)
Common Bugs
758(1)
Basic Debugging Operations
759(8)
Setting Breakpoints
761(2)
Setting Tracepoints
763(1)
Starting Debugging
763(4)
Changing the Value of a Variable
767(1)
Adding Debugging Code
767(8)
Using Assertions
768(1)
Adding Your Own Debugging Code
769(6)
Debugging a Program
775(5)
The Call Stack
775(2)
Step Over to the Error
777(3)
Testing the Extended Class
780(3)
Finding the Next Bug
783(1)
Debugging Dynamic Memory
783(10)
Functions for Checking the Free Store
784(1)
Controlling Free Store Debug Operations
785(1)
Free Store Debugging Output
786(7)
Debugging C++/CLI Programs
793(11)
Using the Debug and Trace Classes
793(10)
Getting Trace Output in Windows Forms Applications
803(1)
Summary
804(3)
Windows Programming Concepts
807(36)
Windows Programming Basics
808(6)
Elements of a Window
808(2)
Windows Programs and the Operating System
810(1)
Event-Driven Programs
811(1)
Windows Messages
811(1)
The Windows API
811(1)
Windows Data Types
812(1)
Notation in Windows Programs
813(1)
The Structure of a Windows Program
814(20)
The WinMain() Function
815(12)
Message Processing Functions
827(6)
A Simple Windows Program
833(1)
Windows Program Organization
834(1)
The Microsoft Foundation Classes
835(5)
MFC Notation
836(1)
How an MFC Program Is Structured
836(4)
Using Windows Forms
840(1)
Summary
841(2)
Programming for Multiple Cores
843(32)
Parallel Processing Basics
843(1)
Introducing the Parallel Patterns Library
844(1)
Algorithms for Parallel Processing
844(6)
Using the parallel_for Algorithm
845(1)
Using the parallel_for_each Algorithm
846(3)
Using the parallel_invoke Algorithm
849(1)
A Real Parallel Problem
850(14)
Critical Sections
864(3)
Using critical_section Objects
865(1)
Locking and Unlocking a Section of Code
865(2)
The combinable Class Template
867(2)
Tasks and Task Groups
869(4)
Summary
873(2)
Windows Programming with the Microsoft Foundation Classes
875(28)
The Document/View Concept in MFC
876(4)
What Is a Document?
876(1)
Document Interfaces
876(1)
What Is a View?
877(1)
Linking a Document and Its Views
878(1)
Your Application and MFC
879(1)
Creating MFC Applications
880(19)
Creating an SDI Application
882(4)
MFC Application Wizard Output
886(11)
Creating an MDI Application
897(2)
Summary
899(4)
Working with Menus and Toolbars
903(42)
Communicating with Windows
903(6)
Understanding Message Maps
904(3)
Message Categories
907(1)
Handling Messages in Your Program
908(1)
Extending the Sketcher Program
909(1)
Elements of a Menu
910(3)
Creating and Editing Menu Resources
910(3)
Adding Handlers for Menu Messages
913(11)
Choosing a Class to Handle Menu Messages
914(1)
Creating Menu Message Functions
915(1)
Coding Menu Message Functions
916(4)
Adding Message Handlers to Update the User Interface
920(4)
Adding Toolbar Buttons
924(4)
Editing Toolbar Button Properties
925(1)
Exercising the Toolbar Buttons
926(1)
Adding Tooltips
927(1)
Menus and Toolbars in a C++/CLI Program
928(14)
Understanding Windows Forms
928(1)
Understanding Windows Forms Applications
929(3)
Adding a Menu to CLR Sketcher
932(3)
Adding Event Handlers for Menu Items
935(1)
Implementing Event Handlers
936(1)
Setting Menu Item Checks
937(1)
Adding a Toolbar
938(4)
Summary
942(3)
Drawing in a Window
945(64)
Basics of Drawing in a Window
945(3)
The Window Client Area
946(1)
The Windows Graphical Device Interface
946(2)
The Drawing Mechanism in Visual C++
948(11)
The View Class in Your Application
949(1)
The CDC Class
950(9)
Drawing Graphics in Practice
959(2)
Programming for the Mouse
961(29)
Messages from the Mouse
962(1)
Mouse Message Handlers
963(2)
Drawing Using the Mouse
965(25)
Exercising Sketcher
990(3)
Running the Example
991(1)
Capturing Mouse Messages
992(1)
Drawing with the CLR
993(14)
Drawing on a Form
993(1)
Adding Mouse Event Handlers
994(2)
Defining C++/CLI Element Classes
996(8)
Implementing the MouseMove Event Handler
1004(1)
Implementing the MouseUp Event Handler
1005(1)
Implementing the Paint Event Handler for the Form
1006(1)
Summary
1007(2)
Creating the Document and Improving the View
1009(50)
Creating the Sketch Document
1009(5)
Using a list<T> Container for the Sketch
1010(4)
Improving the View
1014(8)
Updating Multiple Views
1014(2)
Scrolling Views
1016(5)
Using MM_LOENGLISH Mapping Mode
1021(1)
Deleting and Moving Shapes
1022(1)
Implementing a Context Menu
1022(16)
Associating a Menu with a Class
1023(3)
Exercising the Pop-Ups
1026(1)
Highlighting Elements
1026(4)
Servicing the Menu Messages
1030(8)
Dealing with Masked Elements
1038(1)
Extending CLR Sketcher
1039(17)
Coordinate System Transformations
1039(3)
Defining a Sketch Class
1042(2)
Drawing the Sketch in the Paint Event Handler
1044(1)
Implementing Element Highlighting
1044(6)
Creating Context Menus
1050(6)
Summary
1056(3)
Working with Dialogs and Controls
1059(64)
Understanding Dialogs
1059(1)
Understanding Controls
1060(1)
Creating a Dialog Resource
1061(2)
Adding Controls to a Dialog Box
1062(1)
Testing the Dialog
1063(1)
Programming for a Dialog
1063(4)
Adding a Dialog Class
1063(1)
Modal and Modeless Dialogs
1064(1)
Displaying a Dialog
1065(2)
Supporting the Dialog Controls
1067(2)
Initializing the Controls
1068(1)
Handling Radio Button Messages
1069(1)
Completing Dialog Operations
1069(3)
Adding Pen Widths to the Document
1070(1)
Adding Pen Widths to the Elements
1070(1)
Creating Elements in the View
1071(1)
Exercising the Dialog
1072(1)
Using a Spin Button Control
1072(6)
Adding the Scale Menu Item and Toolbar Button
1073(1)
Creating the Spin Button
1073(1)
Generating the Scale Dialog Class
1074(3)
Displaying the Spin Button
1077(1)
Using the Scale Factor
1078(6)
Scalable Mapping Modes
1078(2)
Setting the Document Size
1080(1)
Setting the Mapping Mode
1080(2)
Implementing Scrolling with Scaling
1082(2)
Using the CTaskDialog Class
1084(5)
Displaying a Task Dialog
1084(2)
Creating CTaskDialog Objects
1086(3)
Working with Status Bars
1089(4)
Adding a Status Bar to a Frame
1089(4)
Using a List Box
1093(3)
Removing the Scale Dialog
1093(1)
Creating a List Box Control
1094(2)
Using an Edit Box Control
1096(9)
Creating an Edit Box Resource
1096(1)
Creating the Dialog Class
1097(2)
Adding the Text Menu Item
1099(1)
Defining a Text Element
1100(1)
Implementing the CText Class
1100(5)
Dialogs and Controls in CLR Sketcher
1105(15)
Adding a Dialog
1106(6)
Creating Text Elements
1112(8)
Summary
1120(3)
Storing and Printing Documents
1123(52)
Understanding Serialization
1123(1)
Serializing a Document
1124(7)
Serialization in the Document Class Definition
1124(1)
Serialization in the Document Class Implementation
1125(3)
Functionality of CObject-Based Classes
1128(1)
How Serialization Works
1129(2)
How to Implement Serialization for a Class
1131(1)
Applying Serialization
1131(8)
Recording Document Changes
1131(2)
Serializing the Document
1133(2)
Serializing the Element Classes
1135(4)
Exercising Serialization
1139(1)
Printing a Document
1140(4)
The Printing Process
1141(3)
Implementing Multipage Printing
1144(11)
Getting the Overall Document Size
1145(1)
Storing Print Data
1146(1)
Preparing to Print
1147(1)
Cleaning Up after Printing
1148(1)
Preparing the Device Context
1149(1)
Printing the Document
1150(4)
Getting a Printout of the Document
1154(1)
Serialization and Printing in CLR Sketcher
1155(17)
Understanding Binary Serialization
1155(5)
Serializing a Sketch
1160(11)
Printing a Sketch
1171(1)
Summary
1172(3)
Writing Your Own DLLs
1175(18)
Understanding DLLs
1175(6)
How DLLs Work
1177(3)
Contents of a DLL
1180(1)
DLL Varieties
1180(1)
Deciding What to Put in a DLL
1181(1)
Writing DLLs
1182(8)
Writing and Using an Extension DLL
1182(8)
Summary
1190(3)
Index 1193
Ivor Horton is one of the preeminent authors of tutorials on the Java, C and C++ programming languages. He is widely known for his unique tutorial style, which is readily accessible to both novice and experienced programmers. Horton is also a systems consultant in private practice. He previously taught programming for more than 25 years.