Re: objects as parameters
From: Anthony C (AntMJ2317_at_comcast.net)
Date: 05/14/04
- Next message: Surely: "Re: nifty trick for a substring in ANSI C?"
- Previous message: Anthony C: "Re: objects as parameters"
- Maybe in reply to: Anthony C: "objects as parameters"
- Next in thread: Anthony C: "Re: objects as parameters"
- Reply: Anthony C: "Re: objects as parameters"
- Reply: David White: "Re: objects as parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 13 May 2004 23:02:00 -0400
osmium wrote:
> Anthony C writes:
>
>
>>i have tried making a reference copy of the cat,im not getting anywhere,
>>this is what ive tried...this is just a snippet
>>
>>void test(cat& catOne)
>>{
>>cout << catOne.getAge() << endl;
>>}
>>
>>int main()
>>{
>>cat Frisky;
>>
>>Frisky.setAge(5);
>>
>>test(Frisky);
>>return 0;
>>}
>>
>>the reference parameter is there, ive passed it in, unless im doing
>>something very wrong, that 'should' work, should it not?
>>
>>unless your talking pointers and using the -> operator?
>
>
> Nothing stands out to me as being wrong. Why not post the class too? No, I
> didn't mean ->. It looks like pass by value should be OK too, based on the
> function names and my guesses as to what you are doing.
>
>
well, passing by value isnt going to accomplish much for me since
private variables are changed throughout the program. passing by
reference would be best for me atm. just need to figure out how to do it
- Next message: Surely: "Re: nifty trick for a substring in ANSI C?"
- Previous message: Anthony C: "Re: objects as parameters"
- Maybe in reply to: Anthony C: "objects as parameters"
- Next in thread: Anthony C: "Re: objects as parameters"
- Reply: Anthony C: "Re: objects as parameters"
- Reply: David White: "Re: objects as parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|