function - Call flow for the code - C -
I'm looking for a microcontroller in some code. I think mostly code, but this piece of code is bothering me, including the relevant definitions for the data types used. I have replaced the function and variable names for ease. I
define typefif zero (* some_type) (zero * p); some_type some_arr [COUNT] = {NULL,}; Zero init (zero) {first_function (and second_function); } Zero first_function (some_type cb) {if (some_arr_count & lt; COUNT) {some_arr [some_arr_count ++] = cb; }} void second_function (Zero * P) {another_type * req; Req = (another_type *); p; // some other code goes here} 1. What does this typingfiff mean? typed zero (* some_type) (zero * P); The init () function is called only once and there is only one line of code in it.
2. What does this line do? first_ work (& second_function); I searched the entire project code for the second task, and this only shows the only place in addition to the function definition.
3. Then how does one get another job?
-
the following typedef typedef zero (* some_type) (zero * p); void () (zero *) As an indicator for some_type will define. > -
The following statement
first_ work (& second_function); A function call, and other work / <> code, which is the address of second_function , it is argued that first_function () . -
The function another function can be called this way some_arr [some_arr_count] (p); some_arr [some_arr_count] is a function indicator second_function , which is assigned in first_function , and The argument of p is the function of second_function , which is an indicator for zero .
Comments
Post a Comment