I heard somewhere that you can drop down to C++ directly inside C# code. How is this done? Or did I hear wrong?
Note: I do not mean C++ / CLI.
I heard somewhere that you can drop down to C++ directly inside C# code. How is this done? Or did I hear wrong?
Note: I do not mean C++ / CLI.
You might be thinking of unsafe
blocks where you can write code that looks a lot like C++, since you can use pointers.
Why would you need to do that? You can reference native C libraries, but I doubt very much that you can run native code from within managed code.
You can drop down to Assembly from C, because C is instruction-set-semi-agnostic Assembly.
You can drop down to C from C++, because C++ is C plus some other things that make it divinely ugly or horrifically beautiful, depending on your perspective.
You can't drop down from C# to C++, because they are entirely different things. There is no direct relation between them, aside from the curly-brackets-and-semicolons syntax. C# is not a superset of C++, nor a subset of it, nor a sibling of it (but perhaps a second cousin).
That said, C# provides facilities for interacting with external code at all levels of abstraction, from Platform-Invoke (calling functions written in C) to COM to a wide variety of other kinds. But C# itself is not directly related to these things.