Re: Choosing function parameter types - pointers or objects?
- From: Frederick Gotham <fgothamNO@xxxxxxxx>
- Date: Fri, 30 Jun 2006 18:51:38 GMT
ballpointpenthief posted:
I know this question is a bit vague, but I was wondering about any
rules / guidelines / style issues, for when to use pointers, and when
not to, in your function parameters?
You'd have the measure the efficiency of:
(1) Passing the object by value (thus copying it in the process).
and
(2) Passing its address, and dereferencing the address.
For the intrinsic types, (1) is faster.
For a huge type, an object of which is perhaps a kilobyte, (2) would be
faster.
I'm sure the others can give you a more detailed reply.
--
Frederick Gotham
.
- References:
- Choosing function parameter types - pointers or objects?
- From: ballpointpenthief
- Choosing function parameter types - pointers or objects?
- Prev by Date: Re: Choosing function parameter types - pointers or objects?
- Next by Date: Re: OT: Windows console programs (was Re: Function Pointers)
- Previous by thread: Re: Choosing function parameter types - pointers or objects?
- Index(es):
Relevant Pages
|