Today, when I browsed my post on www.armfans.net, I saw a very interesting and learning post, which gave me the use of function pointers in C. Now I want to repeat the content as follows:
A short period of wonderful C language, 1 and 2 to implement the same function. Welcome to share with us (Thank you very much, Mr. Trio)
1 void (* theuboot) (void );
....
Theuboot = (void (*) (void) (0x30700000 );
* Theuboot ();
.....
2 (* (void (*) (void) (0x30700000) (); the function pointer previously felt very Virtual. I have never seen a real example. This time I saw one, I think it is very helpful. I didn't quite understand it at the beginning. After the introduction of trio and the advanced C language courses, I understand theuboot = (void (*) (void) (0x30700000) converts the absolute address 0x30700000 into a function pointer assigned to theuboot, and then references the function pointed to by theuboot, this is useful for special functions that only know the function entry address, such as those that have not been declared, or functions that are not called in the same project.