This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re[2]: unneeded stuff when call
- From: RomikB <romikb at mail dot ru>
- To: "Anirudha" <anirudha at cmcltd dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 4 Jul 2003 20:56:17 +0300
- Subject: Re[2]: unneeded stuff when call
- Organization: RBG
- References: <001901c341e6$40f3aa20$bd0c10ac@cmcltd.com>
- Reply-to: RomikB <romikb at mail dot ru>
Hello Anirudha,
Friday, July 04, 2003, 7:35:34 AM, you wrote:
Is there was answer on my question? If yes, than please explain
A> i knew from what i read that references in C++ are constant pointers which
A> are automatically dereferenced..
A> And once a reference is initialized to an object, it cannot be changed to
A> refer to another object.
A> so something like this shud not work..
A> int main()
A> {
A> int p=15;
A> int m=10;
A> int &s=p;
A> s=m;
A> }
A> on the last line it shud give compile time error.
A> But it's compiling as well as running fine in GCC..
A> am i missing something ?
A> "The tragedy of life doesn't lie in not reaching your goal. The tragedy lies
A> in having no goal to reach."
--
Best regards,
RomikB mailto:romikb@mail.ru