justin = { main feed , music , code , askjf , pubkey };
Ask Justin Frankel
No reasonable question unanswered since 2009!

Suggested topics: programming, music, sleep, coffee, etc.

Note: please do not ask questions about REAPER features, bugs or scheduling, use the forums instead.


Name: Ask: Human (enter yes):
[back to index] | [unreplied] | [replied] | [recent comments] | [all]

Question: Which do you use and why: void foo(int *num) or void foo(int &num)
Asked by Rodrigo (187.112.67.x) on January 18 2014, 6:59pm
Reply on January 18 2014, 10:25pm:
    I would typically use a pointer rather than a reference for more instances, because then looking at the calling code it is clear that the parameter could be modified. Using a reference has the advantage of not being allowed to receive NULL, though. If everything was very const-heavy on the calling side I might be inclined to use a reference, but probably not enough...

Comment:
    Your Name:   -- Site Owner's Name:  (for human-verification)

    Comment:    

    
  
[back to index] | [unreplied] | [replied] | [recent comments] | [all]
Copyright 2025 Justin Frankel. | RSS