Re: objects as parameters
From: Francis Glassborow (francis_at_robinton.demon.co.uk)
Date: 05/14/04
- Next message: Val: "Re: vector::iterator usage help needed"
- Previous message: Francis Glassborow: "Re: objects as parameters"
- In reply to: Anthony C: "Re: objects as parameters"
- Next in thread: Anthony C: "Re: objects as parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 14 May 2004 09:53:57 +0100
In message <wKSdnRfxvr1Tsjnd4p2dnA@comcast.com>, Anthony C
<AntMJ2317@comcast.net> 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?
Indeed it should, so if it isn't you will need to look elsewhere for the
problem. When you say does not work, do you mean does not compile, does
not link or does not execute as expected?
>
>unless your talking pointers and using the -> operator?
No, forget pointers (don't use them unless they are actually necessary)
-- 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: Val: "Re: vector::iterator usage help needed"
- Previous message: Francis Glassborow: "Re: objects as parameters"
- In reply to: Anthony C: "Re: objects as parameters"
- Next in thread: Anthony C: "Re: objects as parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|