Re: Choosing function parameter types - pointers or objects?
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Fri, 30 Jun 2006 20:31:00 GMT
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.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- Follow-Ups:
- Re: Choosing function parameter types - pointers or objects?
- From: Richard Heathfield
- Re: Choosing function parameter types - pointers or objects?
- References:
- Choosing function parameter types - pointers or objects?
- From: ballpointpenthief
- Re: Choosing function parameter types - pointers or objects?
- From: Richard Heathfield
- Choosing function parameter types - pointers or objects?
- Prev by Date: Re: So what Standard are we working off?
- Next 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
|