Can C# do everything C++ can do?
.net, c#, c++, memory
Solution
C# and C++ are languages. It's somewhat elusive to define what a language "can" and "can't" do. One example of a thing that C++ can do and C# can't, is free the memory of an heap allocated object at will, without freeing other unused objects as well. But it's a thing that won't matter most of the time. (You can use `Marshal.AllocHGlobal` and `Marshal.FreeHGlobal` to allocate and deallocate memory like in C.)
The main reason why C++ can be used to write things like Windows drivers is because this is what Windows supports and facilitates. If one day Microsoft decided to support only C# and ditch C++, we'd be here saying that C# can do something that C++ can't (even if the languages magically remained as they are now, by then). Most likely it won't, and rightly so, because C++ is better fit for systems programming than C#. But hopefully you get the point.
Essentially, it's not a matter of the languages themselves, but their implementations, their tools and the world around them. For example, you can easily write an operating system in C#. Why? Because there's a proper tool for it. You can also write for embedded systems with non-real-time requirements. It has nothing to do with the language, again, it's because there's a tool for it.
That being said, do learn C++. Regardless of how it compares with other languages, it's absolutely useful.
Problem
I'm a C# programmer for a few months, and lately I've been considering learning C++. So my question is, is there anything C++ can do that C# can't do? I know about the manual memory management in C++, but as long as I don't program operating systems or extremely heavy memory applications, I shouldn't worry about that too much (becuase I heard .NET handles automatic memory management very well). But, can I program in C# everything that I can in C#? I also mean things like DLL injection, Registry Editing, Drivers and things like that. Is C# considered as powerful as C++? If not, what can't C# do that C++ can?