C pass int array pointer as parameter into a function

前端 未结 9 1484
借酒劲吻你
借酒劲吻你 2020-12-08 04:39

I want to pass the B int array pointer into func function and be able to change it from there and then view the changes in main function

#include 

        
9条回答
  •  天涯浪人
    2020-12-08 05:23

    In the function declaration you have to type as

    VOID FUN(INT *a[]);
    /*HERE YOU CAN TAKE ANY FUNCTION RETURN TYPE HERE I CAN TAKE VOID AS THE FUNCTION RETURN  TYPE FOR THE FUNCTION FUN*/
    //IN THE FUNCTION HEADER WE CAN WRITE AS FOLLOWS
    void fun(int *a[])
    //in the function body we can use as
    a[i]=var
    

提交回复
热议问题