Need help on translating some c++ to c#

Hi I am currently doing a port of Box2D to XNA. I have lots of c# experience but little to none c++ knowledge so I've run into a c++ to c# translation issue... What does the following line of c++ mean, or better yet how does it translate to c#?

// Size the island for the worst case.
b2Island island(m_bodyCount, m_contactCount, m_jointCount, &m_stackAllocator, m_contactListener);

Kind regards,
Johannes
I don't actually know any c#, but I'll give it a shot.

b2Island is the class name, island is the instance name, and the stuff in the brackets is the parameters passed in to the constructor. I believe the main difference is the lack of the 'new' keyword.

The other thing is the '&' symbol which indicates that a pointer will be passed to constructor rather than the object itself.
I had a quick look and I think in c# you would use the 'ref' keyword to the same effect?

So if that's right then it should translate to this:

Code:
// Size the island for the worst case.
b2Island island = new b2Island(m_bodyCount, m_contactCount, m_jointCount, ref m_stackAllocator, m_contactListener);

It probably wouldn't hurt to look in to learning a bit of c++, maybe read up on the differences between the languages, particularly in regard to pointers and references and such.

Hope that helps in some way..
-Matt
There is a C# port underway already:

http://www.box2d.org/forum/viewtopic.php?f=5&t=481
@skatehead:
Thanks for your reply... Should have looked at the island constructor myself, I guess I better go to bed. 😉

@Erin:
Yeah, thanks... But I think I will make my own port anyways. I mean, it's good practice in C++ as well as understanding the inner workings of your brilliant 2d physics framework. It is also good practice in making performant C# and XNA code. So it's basically a 4-way learning experience, and I'm the type who like learning new stuff. 🙂
Cool, porting Box2D is a great way to learn what makes it tick. If the task starts to feel too big, you can still learn a lot by porting Box2D_Lite: http://www.gphysics.com/downloads

Original thread: https://box2d.org/forum/viewtopic.php?t=562