|
-
July 8th, 2009, 08:47 AM
#4
Re: array of pointers to class
 Originally Posted by monarch_dodra
I could be wrong:
(1) What you are passing is not a pointer to an array, but an array of pointers, so:
(2) In c++ arrays are always implicitly passed by reference.
I'd like someone more experienced to confirm though.
Oh.. I missed that. Thank you very much.
 Originally Posted by treuss
Your program does not work perfectly, it leaks memory. While this may not be noticable during short tests it certainly is a defect.
When passing arrays to a function, arrays degenerate to pointers to their first element. There is no need to pass these pointers by reference as the pointers themselves are not changed by the function, neither would it be faster.
Why my program is not working perfectly?
Also is it same *& and &* ??
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|