954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

C++ and C# Compatibility?

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

WolfShield
Posting Whiz in Training
236 posts since Oct 2010
Reputation Points: 28
Solved Threads: 4
 

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.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

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

WolfShield
Posting Whiz in Training
236 posts since Oct 2010
Reputation Points: 28
Solved Threads: 4
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: