Friday, 15 April 2011

c - how to change what function returns without changing header file -



c - how to change what function returns without changing header file -

for assignment must utilize predetermined header file - can not create changes it.

however of functions homecoming node (a struct node), them homecoming pointer node.

is there way alter function phone call in functions.c file?

if not 1 time node returned how can have pointer point it??

for example:

bst_node_t bstsearchnode( bst_root_t root, bst_key_t key, cmp_func_t cmp_func );

is function prototype in header file. homecoming pointer node instead of node itself.

no can't, function declarations , definitions have match.

out of curiosity assignement checked programm, link implementation, , seek , phone call bstsearchnode function ? in case, want define right way...

edit : next comment, assignement implement function defined, , not alter homecoming type. so, ;)

it might simpler maintain passing value around asked (if seek pass pointer data, you'll have carefull memory node allocated, owns it, etc...). api header might not adapted this.

of course, applies if bst_node_t typedef pointer entity, in case have nil change. hard tell without header...

c function struct

No comments:

Post a Comment