Re: objects as parameters
From: Francis Glassborow (francis_at_robinton.demon.co.uk)
Date: 05/14/04
- Next message: Francis Glassborow: "Re: objects as parameters"
- Previous message: Francis Glassborow: "Re: strdup and memory leak ...."
- In reply to: Anthony C: "objects as parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 14 May 2004 09:50:29 +0100
In message <_tqdnVxfq6lTvznd4p2dnA@comcast.com>, Anthony C
<AntMJ2317@comcast.net> writes
>I wrote a simple game in c++ and it uses a class object(cat) that ive
>custom made. My question is this, i do not want to put a lot of code
>into main as the code becomes jumbled and very unreadable with 4 pages
>of code. I need to know how to pass my cat object(for example Garfield
>in this case) as a parameter into another function. I've tried a few
>things, but obviously have had no luck, any help is welcomed :-)
Well if you want Garfield to do things to other object pass him around
by const reference. If you want him to do things to himself, or have
things done to him that change him pass him around by reference. If you
do not understand what this means it is time to do some more study.
-- Francis Glassborow ACCU Author of 'You Can Do It!' see http://www.spellen.org/youcandoit For project ideas and contributions: http://www.spellen.org/youcandoit/projects
- Next message: Francis Glassborow: "Re: objects as parameters"
- Previous message: Francis Glassborow: "Re: strdup and memory leak ...."
- In reply to: Anthony C: "objects as parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|