I saw this question in Baidu just now and answered it. This is a good question. Let's summarize it.
Declare a two-dimensional array
int matrix[100][100];
When two-dimensional arrays are passed as parameters, many people may write intfun (INT **
PS : Const object can only be called Const Function!! Non- const objects casually!! Member pointers are applied only to non- static members of the class. The static class member is not part of any object, so no special syntax is required to point to
// ================================================ ====================================// TITLE:// C ++ vs c # (7): pointer to and delegate to a function// AUTHOR:// Norains// DATE:// Thursday 17-jaruary-2011// Environment:// Visual Studio 2010//
Const pointer and pointer to const
There are two meanings when using a pointer with Const. One means that you cannot modify the content of the pointer, And the other means that you cannot modify the content pointed to by the pointer. It sounds a
Pointer to class members, which is rarely used in the impression. When I re-learn C ++, I found that I ignored a very important thing, I used to think that the member functions of the class cannot be used as Callback functions. Therefore, many C
Original article Chen Hao
Link: http://coolshell.cn/articles/8990.html
Thanks to full_of_bull for posting this article(Note: This article was originally published here. I modified a lot in the second half of the original article and added
There is always a newly-introduced Windows programmer asking me what the Windows handle is, and I say you see it as a pointer-like identifier, but obviously the answer doesn't make them happy, and then I say go ask the Niang, they say not too much
"Reference in standard containers" and "pointer to reference )"
As we all know, standard containers store and manipulate the instances stored in them by value and do not allow the storage of reference in standard containers"
.
Vector ;
After
Recently, function pointers have been used in development, so I want to sort out the concept of function pointers. O (distinct _ distinct) O ~
First, the function pointer is a pointer to a group of functions of the same type. We can also think
To illustrate:function declaration: void Fun (int (*p) [4]);void Fun (int (*p) [4]){int i=0,j=0;for (i=0;ifor (j=0;jcout }P is a pointer to a[0], then P+i is a pointer to A[i], * (p+i) is a pointer to a[i][0],Then * (p+i) +j is a pointer to a[i][j],
Array pointers: First look at the name "array pointer" is "pointer", it can be understood as a pointer. But there is an array in front of it, that is, it points to an array.See-"Int (*p) [Ten], we parse from an expression, because () has a high
directory of this document
one, pointing to the elements of a one-dimensional array
second, Use the pointer to iterate over the array elements
Iii. summary of pointers and arrays
Iv. arrays, pointers, and function parameters
Let's take a look at what is a constant pointer and what is a pointer to a constant!
1. Constant pointer Definition
1 int * const PTR = new int ();
2. pointer to a constant
1 const int * PTR;
We have seen how constant pointers and pointer
1. Array of pointers: arrays of pointers, arrays of pointers1 int *arr1[// store 10 array of shaping pointers 2char *arr2[4]// Array of 4-character pointers 3char **arr3[5]//Is also an array of pointers2. Array pointers: Array pointers are
directory of this document
One, pointing to the elements of a one-dimensional array
Second, use the pointer to iterate over the array elements
Iii. summary of pointers and arrays
Iv. arrays, pointers, and function parameters
C + +: A reference to a pointer and pointer to an ascending _ pointer◇ written in front Today, when I was using pointers, I found a mistake of my own. I just started thinking that the output of the two P are 6, at the time that two P refers to the
A pointer pointing to any object type can be assigned to a variable of Type void *, void * can be assigned to another void *, and two voids * can be equal or not, in addition, you can explicitly convert void * to another type. Other operations are
Error 1 :/usr/src/php-5.2.9/ext/dom/node.c:in function ' dom_canonicalization ':/usr/src/php-5.2.9/ext/dom/node.c:1950:21:error:dereferencingpointer to incomplete typeRET = buf->buffer->use;^Infile included
Thank you: http://topic.csdn.net/t/20050429/20/3976956.htmlThank you: http://yzyanchao.blogbus.com/logs/47796444.htmlBut over there is reproduced from the "effective STL".Std::vector is very convenient, but sometimes called the function of the
A pointer to a variable represents the starting position in memoryA pointer to a variable in the struct represents the starting position of the struct variable in memory, and it can also point to an array of struct variables To define a pointer to a
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.