Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Complex examples of C language pointers

Shulou Source: shulou.com Published: 2022-06-01 06:51:19 10月03日 Update

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

Tags: Pointers programs functions variables everyone complex pointing that is address such actual time division running water water lamp buffer trouble popular sensitive overwhelmed that is to say Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Docker MySQL Redmi Shulou Technology