Function does not change passed pointer C++

前端 未结 4 493
北海茫月
北海茫月 2020-11-22 01:58

I have my function and I am filling targetBubble there, but it is not filled after calling this function, but I know it was filled in this function because I ha

4条回答
  •  清酒与你
    2020-11-22 02:47

    You are passing the pointer by value.

    Pass a reference to the pointer if you want it updated.

    bool clickOnBubble(sf::Vector2i& mousePos, std::vector bubbles, Bubble *& t)
    

提交回复
热议问题