Re: Choosing function parameter types - pointers or objects?
- From: Richard Heathfield <invalid@xxxxxxxxxxxxxxx>
- Date: Fri, 30 Jun 2006 21:10:06 +0000
Keith Thompson said:
Richard Heathfield <invalid@xxxxxxxxxxxxxxx> writes:
ballpointpenthief said:
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?
If it's a native type (int, short, long, double, that sort of thing),
pass it in raw unless you need to hack its value. Anything else - structs
and stuff - pass a pointer.
I wouldn't hesitate to pass a *small* structure directly.
I would. Small structures have a habit of growing larger. :-)
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
.
- References:
- Choosing function parameter types - pointers or objects?
- From: ballpointpenthief
- Re: Choosing function parameter types - pointers or objects?
- From: Richard Heathfield
- Re: Choosing function parameter types - pointers or objects?
- From: Keith Thompson
- Choosing function parameter types - pointers or objects?
- Prev by Date: Re: So what Standard are we working off?
- Previous by thread: Re: Choosing function parameter types - pointers or objects?
- Next by thread: Re: Choosing function parameter types - pointers or objects?
- Index(es):
Relevant Pages
|