quote: Original post by Anonymous Poster
It''s not neccesary to create a pointer for the sole purpose of passing it to a function. This is where the reference operator comes in.
The reference operator is not required here. It''s never required. It does EXACTLY the same things a pointer can do, with some limitations. In this instance, either would work fine.
quote:
This is pure abuse of the new operator. Sure it''s legal, but think of the moral implications: memory leaks.
Errr.... moral implications? hehe...kay. Anyways, this is not only legal, but good programming practice, as it exactly specifies object lifetimes. True, there''s the potential for memory leaks, but that''s the price you pay for flexibility. It''s silly to dismiss a technique just because use of it without understanding its ramifications can lead to problems.
quote:
Another example where the reference operator is clearly superior considering a fixed number of Monsters and players allocated.
Perhaps you could expand on this? what advantage do references give you here?
*** 500 ERROR ***
Don''t listen to me. I''ve had too much coffee.