Are the following data type allocations analagous?

Posted by byte on Stack Overflow See other posts from Stack Overflow or by byte
Published on 2010-05-19T04:24:33Z Indexed on 2010/05/19 4:30 UTC
Read the original article Hit count: 216

Filed under:
|
|
|

I'm very interested in languages and their underpinnings, and I'd like to pose this question to the community. Are the following analagous to eachother in these languages?

C#

Foo bar = default(Foo); //alloc
bar = new Foo(); //init

VB.NET

Dim bar As Foo = Nothing  'alloc
bar = New Foo()   'init

Objective-C

Foo* bar = [Foo alloc];   //alloc
bar = [bar init];    //init

© Stack Overflow or respective owner

Related posts about c#

Related posts about vb.net