passing a pointer by reference in c++

后端 未结 2 1460
说谎
说谎 2021-01-12 23:54

I have a function where I\'m passing in an iterator to a char * buffer (which is also a char *). The function needs to increment the iterator. Anyway, I found that a good

2条回答
  •  死守一世寂寞
    2021-01-13 00:12

    I don't think there's any difference between the two. You should ask your coworker why he believes there is.

    What might be the cause is for maintainability, where if you wanted to switch from unsigned char * to char * you'd only have to change one place. But this, I think, could lead to other problems.

提交回复
热议问题