Re: Bug in g++'s int constructor?
Re: Bug in g++'s int constructor?
- Subject: Re: Bug in g++'s int constructor?
- From: "Clark S. Cox III" <email@hidden>
- Date: Fri, 29 Mar 2002 04:08:47 -0500
On 03/28/2002 22:03, "Dennis De Mars" <email@hidden> wrote:
>
On Thursday, March 28, 2002, at 05:06 PM, Mark wrote:
>
>
> Well that's what I had to do get the program running so I could pass it
>
> in. It just made tracking down the problem with my CS prof. frustrating
>
> for us both, since we both made assumptions that this was implemented
>
> correctly. It isn't a major flaw, but it should still be fixed. I was
>
> just curious as to if anyone has filled a bug report about this...
>
>
>
> Am I off base on this? As far as I'm concerned compiler consistency is
>
> a good thing. Especially if Apple wants Unix source to be ported over
>
> to OS X without causing too high of an aggravation factor, where these
>
> types of assumptions may be made ( as far as I know our digital unix
>
> server we use for compiling at school has no trouble with this ).
>
>
As has been pointed out in other replies, ints don't have "constructors"
They do, but they must be explicitly called. If built in types didn't
have constructors, then it would be impossible to use them with the STL
containers.
>
and they are not guaranteed to be initialized to any particular value
>
unless you explicitly initialize it. This is equally true in C and in
>
C++. The fact that it happened to work the way you expected with another
>
compiler is a matter of chance, the code is incorrect as written.
>
>
The only reason I am responding is just to express amazement that your
>
CS prof seems to be under the same misconception as you about how this
>
is supposed to work!
I am just as surprised, I recommend that Mark double check anything that his
prof says with a good book and/or the folks over at <
news:comp.lang.c++>.
--
Clark S. Cox III
http://clarkcox.dyndns.org/
email@hidden
_______________________________________________
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.