Appeal, c language old man can be helped look, case data transmission refers a question

Img1
Link: Https://s1.ax1x.com/2020/05/25/tCPlK1.png

Img2
Link: Https://s1.ax1x.com/2020/05/25/tCPMvR.png

For the structural style parameter of what Print, is the Num of S of the 3rd parameter 1 ah?

Related Posts

3 thoughts on “Appeal, c language old man can be helped look, case data transmission refers a question

  1. . . . , *(strict Print_s *)arg_list[2]);

    The Const index that sends a structure commonly (perhaps cite, if C++ ) . Won’t go in whole structure a place of strategic importance. Can decrease not only in that way duplicate, friendly also to different Abi.

  2. @thedrwu, good really, thank,

    That if I am direct *arg_list[2] , come by Void* type, is the length of Sizeof(int) only so effective?

    ” the Const index that sends a structure commonly ” , this word, the word of my understanding, I want to use Void *(*shell)(void* Func, . . . ) will come true, errant function is archetypal, func is used send particular function index, from the back variable parameter, with will pass in front the parameter that Func place needs, no matter prototype of what type function can be used, knowing so is parameter what type, parameter how much is number, use Void* so, still have variable parameter

    If the place of understanding or way are wrong, give advice or comments please.

  3. Press inn every time / the width that presses register inspects ABI and decide, not be Sizeof(int) certainly. Va_arg is written very easily into insecure code, write rise very trival also. Either very recommend.

  4. @thedrwu
    My idea before is too innocent, I think this appearance is done, ha,
    Char* Format = “%d”;Int Num = 1;Void *arg_list[8] = {
    &format,
    &num,
    }
    Void *shell(void* Func, void *arg_list[8]){Void *(*local_func)(void* , . . . ) = Func;
    Return Local_func(arg_list[0] , , , , arg_list[7]);
    }
    Shell(printf, arg_list);

    + problem:
    Basically be to encounter, every time the situation with initialization different function, this place cries ‘ call a point ‘ , next I am thinking can interface of whole and all-purpose function, it is OK to know particular function and parameter use normally;

    – idea:
    The word in light of now is like washed-up, do not have a law to specify parameter type, press inn to seem to be pressed incorrect;
    My at the moment can think of to every initialization function writes a separate case only child, pass into Arg_list[8] , in housing child inside specify parameter type, call a dot to call function index next, point to a certain carapace child?

    Does old man have what your brilliant idea?

Leave a Reply

Your email address will not be published. Required fields are marked *