- 博客(27)
- 收藏
- 关注
原创 6 Mechanism: Limited Direct Execution
The first is performance: how can we implement virtualization without adding excessive overhead to the system? The second is control: how can we run processes efficiently while retaining control over ...
2019-08-28 10:52:17 264
原创 Debugging with GDB Summary of GDB
Summary of GDBThe purpose of a debugger such as GDB is to allow you to see what is going on "inside" another program while it executes--or what another program was doing at the moment it crashed....
2019-08-26 13:39:48 184
原创 Dynamic Memory and Class
Letting the program decide about memory during runtime rather than during compile time.
2019-08-14 20:04:01 146
原创 Object initialization
ClassName objectName = 520; //a syntax for initializing a class object when using a constructor with one argument ClassName objectName(520); //standard syntax forms for initializing class ob...
2019-08-09 20:00:47 189
原创 operator overloading
Because operator overloading is implemented with functions, you can overload the same operator many times, as long as each operator function has a distinct signature and as long as each operator funct...
2019-08-07 20:11:14 176
原创 Tempory Variables, Reference Arguments, and const
A C++ function with a const reference formal argument and a nonmatching actural argument mimics the traditional passing by value behavior, generating a temporary variable to hold the value and guarant...
2019-07-31 13:41:14 148
原创 What is an lvalue?
An argument that's an lvalue is a data object that can be referenced by address. Regular variable can befurther characterized as being a modifiable lvalue and the const variable as a no-modifiable l...
2019-07-31 11:41:47 238
原创 Passing by value Versus Passing by reference
Passing by reference allwos a called functioto access variables in the calling fucntion. C++'s addition of the feature is a bread from C, whice only passes by value. Passing by value, recall, results ...
2019-07-31 09:34:58 408
原创 Reference Variables
Reference provide a convenient alternative to pointers for processing large structures with a function, and they are essential for designing classes. You might recall that C and C++ use the & sym...
2019-07-30 22:11:29 248
原创 Inline Versus Macros
#define SQUARE(X) X*Xinline square(double x) {return x*x;}Using macros to perform function-like services. This works not by passinig arguments but through text substitution, with the X action as a...
2019-07-30 21:33:54 128
原创 Inline Functions
Jumping back and forth and keeping trace of where to jump means that there is an overhead in elapsed time to using functions. Inline functions provide an alternative. The compiler replaces the funct...
2019-07-30 21:24:14 157
原创 What does "Function Call" do?
When a program reachs the function call instruction, the program stores the memory address of the instruction immediately following the function call(instruction), copies function arguments to the sta...
2019-07-30 11:34:07 142
原创 How program execute?
The final product of the compilation process (广义的编译,包括预处理、编译、汇编和链接) is an executable program, which consists of a set of machine language instructions. When you start a program, the operating system ...
2019-07-30 11:24:28 195
原创 Classes and Structures
Class descriptions look much like structure declarations with the addition of member functions and the public and private visibility labels. In fact, C+ extends to structures the same features classe...
2019-07-30 08:53:00 138
原创 Public and Private
You can declaer class members, whether they are data items or member functions, either in the public or the private section of a class. But because one of the main precepts of OOP is to hide the dat...
2019-07-29 20:33:56 235
原创 Encapsulation`and Data hiding
Gathering the implementation details together and separating them from the abstration is called encapsulation. Data hiding (putting data into the private section of a class) is an instance of encapsu...
2019-07-29 20:22:34 134
原创 整型常量、实型常量、字符常量、符号常量、枚举常量的区别
整型常量默认数据类型是int,当数值超过int时,类型会变成long,超过long会报warning; 符号常量默认数据类型是int,当数值超过int时,类型会变成long,超过long会报warning; 枚举常量默认数据类型是int,当数值超过int时,类型会变成long,超过long会报warning; 实型常量默认数据类型是double,超过double会报warning;...
2019-07-29 19:35:21 1731
原创 硬盘和硬盘驱动器的区别
硬盘(hard disk)指的是用来存储数据的装置。物理上以金属光盘呈现,两面均可以存储数据,磁道、扇区。 硬盘驱动器(hard disk drive, HDD)指的是个人计算机中控制硬盘寻址以及存取数据的装置,通过硬盘驱动器,计算机才能访问硬盘中存储的数据。物理上指囊括磁盘的外壳,包含接口、磁头等。 尽管硬盘和硬盘驱动器是两个概念,但由于两者通常被封装在一起,所以默认硬盘和硬盘驱动器都是指二...
2019-07-26 16:22:06 7977 5
原创 OOP
Object-oriented programming(OOP) is a particular conceptual approach to designing programs, and C++ has enhanced C with features that ease the way to applying that approach. The following are the most...
2019-07-24 09:18:44 112
原创 The Usual Array Function Idiom
The idiom (pass the array name and size as arguments) works bypassing two numbers--the array address adn the number of elements. As you have seen, the function loses some knowledge about the original...
2019-07-21 15:07:15 105
原创 Function Overloading
Function polymorphism(Function Overloading)is a neat C++ addition to C's capablities. Function overloading lets you use multiple functions sharing the same name. many forms or versions. You can use...
2019-07-21 09:29:33 305
原创 Function Template
template <typename T> The keywords template and typename are obligatory. The template does not create any functions. Instead, it provides the compiler with directions about how to define a fun...
2019-07-20 16:25:11 247
原创 Three exceptions of array name
C/C++ in most contests treats the name of an array as if it were a pointer which point the the first element.There are a three exceptions to this rule.The array declaration uses the array name to ...
2019-07-20 15:07:50 122
原创 Why Prototypes?
The prototype tells the compiler what type of return value, if any, the function has, and it tells the compiler the number and type of function arguments.Still, you might wonder, wht does the compil...
2019-07-20 11:09:05 132
原创 Using library functions
If you're using a library function, the function has already been defined and compiled for you. Also you can and should use a standard library header file to provide the prototype. All that's left to ...
2019-07-20 09:59:54 164
原创 Fun is where you find it.
Fun is where you find it. Look closely, and you can find itin functions. C++ comes with a large library of useful functions (the standard ANSI C library plus serveal C++ classes), but real programmin...
2019-07-20 09:55:54 153
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人