Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 1.226 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
1.226
Dung lượng
17,8 MB
Nội dung
[...]... I have said on many previous occasions, I could not have done it without her Contents Acknowledgments Chapter 1: Programming with Visual C++ 2005 The NET Framework The Common Language Runtime (CLR) Writing C++ Applications Learning Windows Programming Learning C++ The C++ Standards Console Applications Windows Programming Concepts What Is the Integrated Development Environment? Components of the System... Variables Static Variables Namespaces Declaring a Namespace Multiple Namespaces C++/ CLI Programming 78 79 80 81 81 82 84 85 86 86 88 88 91 91 94 95 96 98 99 C++/ CLI Specific: Fundamental Data Types C++/ CLI Output to the Command Line C++/ CLI Specific — Formatting the Output C++/ CLI Input from the Keyboard Using safe_cast C++/ CLI Enumerations 99 104 104 107 108 109 Specifying a Type for Enumeration Constants... of Your Program Dealing with Errors 13 19 23 Setting Options in Visual C++ 2005 Creating and Executing Windows Applications 27 28 Creating an MFC Application Building and Executing the MFC Application 28 30 Creating a Windows Forms Application Summary 31 35 xiii Contents Chapter 2: Data, Variables, and Calculations The Structure of a C++ Program Program Comments The #include Directive — Header Files... 37 38 44 45 46 46 47 49 49 50 Defining Variables 51 Naming Variables 51 Keywords in C++ Declaring Variables Initial Values for Variables 52 52 53 Fundamental Data Types 54 Integer Variables Character Data Types Integer Type Modifiers The Boolean Type Floating-Point Types 54 55 56 57 57 Fundamental Types in ISO/ANSI C++ Literals Defining Synonyms for Data Types Variables with Specific Sets of Values... Modified Program C++/ CLI Programming Understanding Generic Functions Defining Generic Functions Using Generic Functions A Calculator Program for the CLR Removing Spaces from the Input String Evaluating an Arithmetic Expression Obtaining the Value of a Term Evaluating a Number Extracting a Parenthesized Substring Summary Exercises Chapter 7: Defining Your Own Data Types The struct in C++ What Is a struct?... References With Virtual Functions Incomplete Class Definitions Pure Virtual Functions Abstract Classes Indirect Base Classes Virtual Destructors Casting Between Class Types Nested Classes C++/ CLI Programming Inheritance in C++/ CLI Classes Interface Classes Defining Interface Classes Classes and Assemblies Visibility Specifiers for Classes and Interfaces Access Specifiers for Class and Interface Members... Chapter 14: Drawing in a Window 707 Basics of Drawing in a Window 707 The Window Client Area The Windows Graphical Device Interface What Is a Device Context? Mapping Modes The Drawing Mechanism in Visual C++ The View Class in Your Application The OnDraw() Member Function The CDC Class Displaying Graphics Drawing in Color 708 709 709 709 711 711 711 712 713 717 Drawing Graphics in Practice Programming... the Heap The new and delete Operators Allocating Memory Dynamically for Arrays Dynamic Allocation of Multidimensional Arrays Using References What Is a Reference? Declaring and Initializing References C++/ CLI Programming Tracking Handles Declaring Tracking Handles CLR Arrays Sorting One-Dimensional Arrays Searching One-Dimensional Arrays Multidimensional Arrays Arrays of Arrays Strings Joining Strings... Function Returning a Pointer A Cast Iron Rule for Returning Addresses Returning a Reference A Teflon-Coated Rule: Returning References Static Variables in a Function Recursive Function Calls Using Recursion C++/ CLI Programming Functions Accepting a Variable Number of Arguments Arguments to main() Summary Exercises Chapter 6: More about Program Structure Pointers to Functions Declaring Pointers to Functions... the Type for Enumeration Constants 58 59 60 60 62 Basic Input/Output Operations 62 Input from the Keyboard Output to the Command Line Formatting the Output Escape Sequences 62 63 64 65 Calculating in C++ The Assignment Statement Understanding Lvalues and Rvalues Arithmetic Operations 67 67 68 68 The const Modifier Constant Expressions Program Input Calculating the Result Displaying the Result Calculating . alt="" Ivor Horton’s Beginning Visual C++ ® 2005 Ivor Horton 01_571974 ffirs.qxp 1/20/06 11:22 PM Page iii 01_571974 ffirs.qxp 1/20/06 11:22 PM Page ii Ivor Horton’s Beginning Visual C++ ® 2005 01_571974. ffirs.qxp 1/20/06 11:22 PM Page ii Ivor Horton’s Beginning Visual C++ ® 2005 Ivor Horton 01_571974 ffirs.qxp 1/20/06 11:22 PM Page iii Ivor Horton’s Beginning Visual C++ ® 2005 Published by Wiley Publishing,. Data: Horton, Ivor. Ivor Horton’s Beginning Visual C++ 2005 / Ivor Horton. p. cm. Includes index. ISBN-13: 978-0-7645-7197-8 (paper/website) ISBN-10: 0-7645-7197-4 (paper/website) 1. C++ (Computer