When we use "pass by pointer" to pass a pointer to a function, only a copy of the pointer is passed to the function. We can say "pass by pointer" is passing a pointer by value. In most cases, this does not present a problem. But the problem comes when you modify the pointer inside the function. Instead of modifying the variable, you are only modifying a copy of the pointer and the original pointer remains unmodified, that is, it still points to the old variable.
pointer to pointer/reference to pointer
猜你喜欢
转载自blog.csdn.net/zhhp1001/article/details/86560420
今日推荐
周排行