Re: reference vs pointer .. ?
From: m sergei (sergei_m_1_at_yahoo.com)
Date: 07/07/04
- Previous message: Evan Carew: "Re: Exception stack trace"
- In reply to: John Harrison: "Re: reference vs pointer .. ?"
- Next in thread: Buster: "Re: reference vs pointer .. ?"
- Reply: Buster: "Re: reference vs pointer .. ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 6 Jul 2004 18:32:28 -0700
say class is Test
then
Test *t=new Test();
t->a=9; //to access a member of class Test
how would the & reference work here (instead of *t that was used above)
like Test &t = new Test() //gives compile error
please give the correct usage with & (reference of object)
- Previous message: Evan Carew: "Re: Exception stack trace"
- In reply to: John Harrison: "Re: reference vs pointer .. ?"
- Next in thread: Buster: "Re: reference vs pointer .. ?"
- Reply: Buster: "Re: reference vs pointer .. ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]