Some member functions change objects, while some member functions do not change objects.For example:Int point: Gety (){Return yval;}When this function is called, The point object is not changed, and the following function changes the point
1. Define a const object
Const converts an object into a constant:
Const int bufsize = 512; Define the bufsize as a constant and initialize it to 512.
Since constants cannot be modified after definition, they must be initialized during definition.
As we all know, in PHP (PHP 4 and later), we can use the function define () to define constants, for example:
However, after PHP 5.3.0, in addition to using function define (), we can also use the PHP keyword const to define constants.
For example:
[1 use macros]
1.1# Ifdef ndebug# Define trace (s) S# Else# Define trace (s) printf ("% s;/N", # S); s# Endif
Q: What is the role of the preceding trace () Macro?
1.2 # What is the role of error?
1.3 define a macro and obtain the number of
The 5th Chapter uses function encapsulation program functionAfter completing the powerful payroll program V1.0, we doubled our confidence and began to explore further afield in the C + + world.Now, we can use a variety of data types to define
Hello, C ++ (24) is a big box! 5.1.1 function declaration and definition, and 5.1.1 Declaration
Chapter 2 program function Encapsulation
After completing the powerful wage program V1.0, we have increased our confidence and began to explore the C ++
The difference between "constant" and "read-only variable". Constants are definitely read-only , such as 5, "ABC", and so on, which is definitely read-only, because constants are read-only areas that are placed in memory by the compiler, and
The essence of a pointer: A variable, a pointer variable is a pointer variableint *p: Two variables, one p (the pointer variable itself) is of type int *The other is *p (the variable that the pointer points to) is of type intNote: The pointer is
First question:What is the address of the PTR1 and the address of the &ptr1 that are printed in this image above?I understand the PTR1 address is PTR1 this pointer variable own address, &PTR1 address is PTR1 this pointer point to the address, that
Yesterday interview by the Group of Examiners asked about the const and define similarities and differences, began to be simple, then asked my head is a group of paste. Almost a summary of the information today1. Const and define.Both can be used to
What is the role of the static keyword?Few people can answer this simple question completely. In the C language, the keyword static has three obvious functions:1. In the function body, a variable declared as static remains unchanged when the
(1) Common objects
Objects modified with const are called object constants in the following format:
const or const 〉
When declared as a common object, it must be initialized and cannot be rewritten to the data member of the object.
1.static keywordsThis keyword is also mentioned earlier, and its role is powerful.To gain insight into the static keyword, you first need to master the composition of the standard C program.The standard C program has been composed of the following
1, const understanding const is a keyword in C (c + +), and it is important to note that the const keyword changes a variable to a read-only variable. This variable is definitely not changed to a constant. That is, after the const-modified
First, post a document
Int p; // This is a common integer variable int * p; // It starts from P and is first combined with *, so P is a pointer and then combined with int, indicates that the Pointer Points to the int type of content. so P is a
Reprinted from: http://www.diybl.com/course/3_program/c++/cppsl/2008525/117871.html
(1) Common objectsObjects modified with const are called object constants in the following format: const or const 〉When declared as a common object, it must be
1th: Understand the JS version you useMany JS engines support the const keyword definition variable, but the ECMAScript standard does not define any semantics and behavior about the const keyword. Also, the behavior of the Const keyword is different
The 5th Chapter uses function encapsulation program functionAfter completing the powerful payroll program V1.0, we doubled our confidence and began to explore further afield in the C + + world.Now, we can use a variety of data types to define
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.