开发者

Is there anything you can do in C++ that you cannot do in C#? [closed]

开发者 https://www.devze.com 2023-01-23 01:54 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. 开发者_如何学Go Closed 12 years ago.

I am trying to figure out if there is anything that you can do in c++ that you absolutely cannot do in c#?

I know that there are platforms that are targeted to native libraries, but I want to know if the lowest level c# can compare with the lowest level c++.


Device drivers. These applications operate in kernel mode, and .NET apps don't (they run in user mode). Even if you could, would you really want to? Probably not considering the overhead of the runtime and the relative difficulty of interfacing directly to hardware devices.

In software you can pretty much do anything given enough time and effort. It comes down to whether or not a certain task is practical rather than possible.


inline assembler

there are some very complex win32 signatures that cannot be used via p/invoke; the sspi security interfaces for example


Write Real Mode code. There is no CIL framework that runs in real mode, therefore C# cannot target it. C++ has been able to target real mode for decades now.


You can't use multiple inheritance in C# (Excluding interfaces).


In C++ you can overload more operators: http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B vs: http://msdn.microsoft.com/en-us/library/8edha89s%28v=VS.100%29.aspx


Well, C# handles all the memory management, so you're limited in terms of hands on memory management. This isn't really a bad thing though, as it takes a lot of work away from you as the coder. It becomes a bad thing if you're heavily concerned with performance (games and the likes).

0

精彩评论

暂无评论...
验证码 换一张
取 消