pointer as second argument instead of returning pointer?
- by Tyler
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:
/*function prototype*/
void create_node(node_t* new_node, void* _val, int _type);
/* implementation */
node_t* n;
create_node(n, &someint, INT)
Instead of
/* function prototype */
node_t*…