How to call the static function from another c file?

前端 未结 6 1638
谎友^
谎友^ 2021-02-07 22:48

I want to call a static function from another C file. But it always show \"function\" used but never defined.

In ble.c

6条回答
  •  情深已故
    2021-02-07 23:13

    I agree with Frodo and ANBU.SANKAR Still if you want to call a static function outside the file you can use examples like below.

    1.c

    extern (*func)();
    int main(){
    (func)();
    return 0;}
    

    2.c

    static void call1(){
    printf("a \n");
    }
    (*func)() = &call1;
    

提交回复
热议问题