This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: unneeded stuff when call
- From: "Anirudha" <anirudha at cmcltd dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Fri, 4 Jul 2003 10:05:34 +0530
- Subject: Re: unneeded stuff when call
- References: <176599970.20030703232041@mail.ru>
i knew from what i read that references in C++ are constant pointers which
are automatically dereferenced..
And once a reference is initialized to an object, it cannot be changed to
refer to another object.
so something like this shud not work..
int main()
{
int p=15;
int m=10;
int &s=p;
s=m;
}
on the last line it shud give compile time error.
But it's compiling as well as running fine in GCC..
am i missing something ?
"The tragedy of life doesn't lie in not reaching your goal. The tragedy lies
in having no goal to reach."