When passing vectors to functions, which method should be used: reference or pointer?
In most cases any of the two would do the job. Even in those cases, are there any differences in the way the two methods perform?
I do not see if there are cases where only one of the two would work. Is there any such case?
EDIT: I will call Q1 this question, Q2 the question cited as containing the answer to this OP, and A1/A2 the respective sets of answers. Q2 asks about general differences pointers vs. references (not for passing to functions). That is very different from this Q1 because:
- Many answers for Q2 may not be relevant for Q1.
- Whatever contents in answers for Q2 that is relevant for Q1 would have to be sifted by the readers, some of which may be even unable to do that.
So tagging this a dupe is probably more detrimental for than helping the readers.