In distinguishing these important concepts, let's first review the three values of C in the previous one, because the three values of the address is the same, so there are often rumors that they are the first element of the address. This argument is
#运算符: Used to convert macro parameters to strings during the precompilation period#define Convers (x) #x//NOTE: Double quotation marks are not included.Different types of pointers occupy the same amount of memory space.Local variable definition:A[5];
Annoying function pointer (2), annoying function pointer
Link: http://www.cnblogs.com/AnnieKim/archive/2011/12/04/2275589.html
I have previously written an annoying function pointer (I), which summarizes the declaration, definition, and call of
In C ++/C Programs, pointers and arrays can be replaced with each other in many places, which leads to the illusion that the two are equivalent. But there are essential differences between the two:Array: either created in a static storage area (such
Pointer PreliminaryDefine a pointer variable: int * a=NULL; int is the type of pointer, which is actually the type of data that the pointer points to.When the program runs, the data is placed in memory, and since it is in memory somewhere in memory,
Original article link
Pointers and references are quite different in form, but they all seem to have the same functionality and can directly reference objects and perform direct operations on them. But when should I use pointers? When can I use
1. How arrays are accessed(1) Accessing The elements in the array as subscripts: a[i];(2) To access elements in the array as pointers : * (a+i)2. subscript form VS pointer form(1) When moving in an array with fixed increments in the form of
For character arrays and character pointers:
1. if it appears as a string, the compiler will automatically add a 0 to the string as the Terminator. For example, if you write "ABC" in the Code, the compiler will help you store "ABC \ 0 ".
2. The
1. Copying of arraysPointer-pointing problem when copying an array.When the array is copied, the position of the pointer is copied "This copy is exactly the same"However, if the pointer to the copied array is illegal, the position where the new
Considerations When "pointer" as "function parameter" in C language
In C, pointers are one of the most difficult points of knowledge to grasp, however, in the ordinary textbooks will be more detailed to explain the pointer, if you want to learn
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.