How do I modify a pointer that has been passed into a function in C?

前端 未结 5 1540
予麋鹿
予麋鹿 2020-11-21 05:25

So, I have some code, kind of like the following, to add a struct to a list of structs:

void barPush(BarList * list,Bar * bar)
{
    // if there is no move t         


        
5条回答
  •  太阳男子
    2020-11-21 06:06

    Generic answer: Pass a pointer to the thing you want to change.

    In this case, it would be a pointer to the pointer you want to change.

提交回复
热议问题