Complex examples of C language pointers
Earlier we mentioned that the meaning of the pointer is often in the Mini programs is not expressed, on complex programs, sometimes with the pointer, but can be more troublesome than no pointer, but in order to let everyone stabilize the use of the pointer, I still wrote a pointer using the water lamp program, the goal is to let everyone understand the pointer from the beginning of the complex program, when the program is complex hours will not be at a loss.
#include sbit ADDR0 = P1^0; sbit ADDR1 = P1^1; sbit ADDR2 = P1^2; sbit ADDR3 = P1^3; sbit ENLED = P1^4; void ShiftLeft (unsigned char *p); void main(){ unsigned int i; unsigned char buf = 0x01; ENLED = 0; //Enable Select Independent LED ADDR3 = 1; ADDR2 = 1; ADDR1 = 1; ADDR0 = 0; while (1){ P0 = ~buf; //buffer value is inverted and sent to port P0 for (i=0; i