pointer as second argument instead of returning pointer?

后端 未结 7 503
长情又很酷
长情又很酷 2021-01-18 05:33

I noticed that it is a common idiom in C to accept an un-malloced pointer as a second argument instead of returning a pointer. Example:

/*functi         


        
7条回答
  •  太阳男子
    2021-01-18 05:57

    personally I like to return data using refernce or pointer params, and use the function return for returning error codes.

提交回复
热议问题