similar pointer address

1. &*p=&(*p) is to access the address after taking the value of the address pointed to by the pointer.
2. *1, *100, and *50 are all illegal.
3. *&p=* (&p) is to access the address pointed to by the pointer, that is, the address pointed to by the pointer.
4. **p=*(*p) is a pointer to a pointer.
When p is of type int, &*p is illegal because *p is illegal.
&*p=*&p=p when p is a pointer.
5. malloc is

malloc in C language is a dynamic memory allocation function.
#include" malloc.h "//The malloc() function is included in malloc.h char*a=NULL;//Declare a pointer to a char* type a=(char*)malloc(100*sizeof( char));//Use malloc to allocate the first address of the memory, and then assign it to a.

(allocation type *) malloc (number of allocated elements * sizeof (allocation type))
If successful, return the first address of the space, the space is not initialized, if it fails, return 0


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325654485&siteId=291194637