Introduction xxxv
Chapter 1: Programming with VisuaL C++ 1
Learning with Visual C++ 1
Writing C++ Applications 2
Learning Desktop Applications Programming 3
What is the Integrated Development Environment? 5
Using the IDE 7
Summary 23
Chapter 2: Data, Variables, and Calculations 25
The Structure of a C++ Program 26
Defining Variables 39
Fundamental Data Types 42
Basic Input/Output Operations 50
Calculating in C++ 55
Type Conversion and Casting 66
The auto Keyword 69
Discovering Types 70
The Bitwise Operators 70
Introducing Lvalues and Rvalues 76
Understanding Storage Duration and Scope 77
Variables with Specific Sets of Values 85
Namespaces 90
Summary 93
Chapter 3: Decisions and Loops 97
Comparing Values 97
Repeating a Block of Statements 115
Summary 133
Chapter 4: Arrays, Strings, and Pointers 135
Handling Multiple Data Values of the Same Type 135
Indirect Data Access 150
Dynamic Memory Allocation 170
Using References 176
Library Functions for Strings 178
Summary 185
Chapter 5: Introducing Structure into Your Programs 189
Understanding Functions 189
Passing Arguments to a Function 198
Returning Values from a Function 216
Recursive Function Calls 224
Summary 227
Chapter 6: More About Program Structure 231
Pointers to Functions 231
Initializing Function Parameters 238
Exceptions 239
Handling Memory Allocation Errors 245
Function Overloading 247
Function Templates 251
Using the decltype Operator 254
An Example Using Functions 256
Summary 274
Chapter 7: Defining Your Own Data Types 277
The struct in C++ 277
Types, Objects, Classes, and Instances 287
Understanding Classes 290
Class Constructors 298
Private Members of a Class 307
The Pointer this 314
const Objects 317
Arrays of Objects 320
Static Members of a Class 322
Pointers and References to Objects 325
Summary 330
Chapter 8: More On Classes 333
Class Destructors 334
Implementing a Copy Constructor 340
Sharing Memory Between Variables 342
Operator Overloading 345
The Object Copying Problem 366
Default Class Members 377
Class Templates 378
Perfect Forwarding 388
Using Classes 392
Organizing Your Program Code 412
Library Classes for Strings 414
Summary 437
Chapter 9: Class Inheritance and Virtual Functions 441
Object-Oriented Programming Basics 441
Inheritance in Classes 443
Access Control Under Inheritance 447
The Copy Constructor in a Derived Class 458
Preventing Class Derivation 461
Class Members as Friends 462
Virtual Functions 464
Casting Between Class Types 483
Nested Classes 483
Summary 487
Chapter 10: The Standard Template Library 491
What is the Standard Template Library? 491
Smart Pointers 497
Algorithms 500
Function Objects in the STL 501
Function Adapters 502
The Range of STL Containers 502
Sequence Containers 502
Associative Containers 561
More on Iterators 575
More on Function Objects 582
More on Algorithms 584
Type Traits and Static Assertions 587
Lambda Expressions 588
Summary 598
Chapter 11: Windows Programming Concepts 601
Windows Programming Basics 602
The Structure of a Windows Program 608
The Microsoft Foundation Classes 627
Summary 632
Chapter 12: Windows Programming with the Microsoft Foundation Classes (MFC) 635
The MFC Document/View Concept 636
Creating MFC Applications 640
Summary 657
Chapter 13: Working With Menus and Toolbars 659
Communicating with Windows 659
Extending the Sketcher Program 664
Elements of a Menu 665
Adding Menu Message Handlers 668
Adding Toolbar Buttons 678
Summary 682
Chapter 14: Drawing in a Window 685
Basics of Drawing in a Window 685
The MFC Drawing Mechanism 689
Drawing Graphics in Practice 700
Programming for the Mouse 702
Drawing a Sketch 731
Summary 734
Chapter 15: Improving the View 739
Sketcher Limitations 739
Improving the View 740
Deleting and Moving Elements 748
Implementing a Context Menu 748
Identifying an Element under the Cursor 752
Dealing with Masked Elements 765
Summary 767
Chapter 16: Working with Dialogs and Controls 769
Understanding Dialogs 770
Understanding Controls 770
Creating a Dialog Resource 771
Programming for a Dialog 773
Supporting the Dialog Controls 777
Completing Dialog Operations 780
Using a Spin Button Control 785
Using the Scale Factor 791
Working with Status Bars 797
The CString Class 801
Using an Edit Box Control 802
Summary 812
Chapter 17: Storing and Printing Documents 815
Understanding Serialization 815
Serializing a Document 816
Applying Serialization 823
Exercising Serialization 831
Printing a Document 833
Implementing Multipage Printing 837
Summary 847
Chapter 18: Programming Windows 8 Apps 849
Understanding Windows 8 Apps 850
Developing Windows 8 Apps 851
Windows Runtime Concepts 852
C++ Component Extensions (C++/CX) 853
The eXtensible Application Markup Language (XAML) 859
Creating a Windows 8 App 867
Scaling UI Elements 897
Transitions 899
Summary 902
Index 905
There's a reason why Ivor Horton's Beginning Visual C++ books dominate the marketplace. Ivor Horton has a loyal following who love his winning approach to teaching programming languages, and in this fully updated new edition, he repeats his successful formula. Offering a comprehensive introduction to both the standard C++ languageand to Visual C++, he offers step-by-step programming exercises, examples, and solutions to deftly guide novice programmers through the ins and outs of C++ development.
Even if you have no previous programming experience, you'll soon learn how to build real-world applications using Visual C++ 2012 with this popular guide.
Ivor Horton is one of the preeminent authors of tutorials on the Java, C, and C++ programming languages. He is widely known for the tutorial style of his books, which provides step-by-step guidance easily understood even by first-time programmers. He is also a systems consultant in private practice.
Wrox Beginning guides are crafted to make learning programming languages and technologies easier than you think, providing a structured, tutorial format that will guide you through all the techniques involved.
Schlagwörter zu:
Ivor Horton’s Beginning Visual C++ 2012 von Ivor Horton - mit der ISBN: 9781118439418
Computer Science; Informatik; Programmierung / C u. C++; Programming / C & C++; Visual C++, Online-Buchhandlung
interessiert haben, schauten sich auch die folgenden Bücher & eBooks an: