Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language adds 1 to the pointer address. So how does it move?
C language adds 1 to the pointer address. So how does it move?

It mainly depends on the type of pointer you define. For example, if you define int *p=NULL; then int occupies 4 bytes. The pointer pointing to int is +1, and the memory address pointed to by the pointer is +4; if you define char *p=NULL; then char occupies 1 byte.

The pointer pointing to char +1, the memory address pointed to by the pointer only needs +1