This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Is this a bug or I misunderstand?
- From: "Maggie Mitchell" <maggie_shh at hotmail dot com>
- To: gcc at gnu dot org
- Date: Mon, 17 Jun 2002 05:55:53 +0000
- Subject: Is this a bug or I misunderstand?
- Bcc:
//The codes begin
#include <stdio.h>
class A {
public:
A(int i=0)
{
printf("hello\n");
}
};
int main()
{
printf("begin\n");
A a;
printf("----\n");
A b();
printf("end\n");
return 0;
}
//codes end
I think the result should be
begin
hello
------
hello
end
but the result is
are
begin
hello
-----
end
why?Is It a bug of g++ or I misunderstand the behaviour of constructor?
Regards
Maggie
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com