Re(2): Bug in g++'s int constructor?
Re(2): Bug in g++'s int constructor?
- Subject: Re(2): Bug in g++'s int constructor?
- From: Jens Bauer <email@hidden>
- Date: Fri, 29 Mar 2002 17:44:41 +0100
Hi all,
On Thu, 28 Mar, 2002, Cliff Russell <email@hidden> wrote:
>
AFAIK what you described is not a bug with g++. It is not safe to use a
>
variable without initializing it. (I am pretty sure there aren't
>
constructors for primative types; chars, ints, floats and so on). In the
>
code you provided it is not safe to assume that sum will be initialized
>
to 0 before you use it, so the first line of your code needs to read int
>
sum = 0 to be correct.
You should be able to do this as well:
int sum(3);
which should initialize sum to 3.
Love,
Jens
--
Jens Bauer, Faster Software.
-Let's make the World better, shall we ?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.