Passing char pointer in C

后端 未结 5 890
时光说笑
时光说笑 2020-12-08 05:53

Okay so I am trying to pass a char pointer to another function. I can do this with an array of a char but cannot do with a char pointer. Problem is I don\'t know the size of

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 06:37

    first declare funtion......like this

     #include
     void function_call(char s)
    

    next write main code.....

    void main()
    {
        void (*pnt)(char);  //  pointer function declaration....
        pnt=&function_call;  //    assign address of function
        (*pnt)('b');   //   call funtion....
    }
    

提交回复
热议问题