I am thinking of learning C++ (I already know Python and Java), and a friend of mine is thinking of learning C# (already knows some Java and JavaScript).

I know there is a long debated "C++ or C#" ordeal out there, so I am not asking about that! :) (I've already done my research on that subject).

What I would like to know is: If him and I decided to team up on a project, can we program in our own languages and use them together? Maybe with dlls or byte code (or I guess in this case MSIL)?

And if so, what tool(s) would we need and how would it be done?

Thanks in advance!

- WolfShield

C++/CLI and C# are assembly compatible. You can write an assembly in one language and reference it from the other because they're both CLR-based languages. C# can also reference native C++, but it's not as simple as referencing an assembly because the native C++ DLL would be outside of the CLR framework.

Thanks!

Also I was wondering, how would using both languages change the performance, if at all?

How would a program made with C++ and C# compare to a program made JUST in C++ or JUST in C#?

Thanks again!

- WolfShield

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.