Click here to Skip to main content
15,884,838 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
In many projects me seen that lots of c code(dll)are used while we can make those dll in c# also with minimal efforts ?
actually why we do like this ?
is there any performace issue is involve in this scenario
Posted
Comments
ZurdoDev 31-Aug-12 8:13am    
It is not clear what you are asking but it sounds like you are asking us why your projects have dlls written in C instead of C#?

1 solution

Because C# is nearly completely a Managed environment - if you want access to unmanaged memory, or to interface with the OS (which is unmanaged) then you generally have to use unmanaged code. C++ is the normal choice.

In addition, if you have C or C++ code that works perfectly well, why risk introducing bugs by translating it, if you can use it as-is directly from C#?

There can also be some performance gains by using C++ instead of C# for some things, but it's smaller than you might think for most code, and frequently swamped by the development time.
 
Share this answer
 
Comments
AmitGajjar 31-Aug-12 8:27am    
5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900