C Sharp: Difference between revisions
No edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 69: | Line 69: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==Memory Management== | |||
C# has value types and reference types. Reference types are heap allocated similar to Java. Value types are allocated either on the stack or within objects on the heap, the same as primitives in Java or structs in C/C++. | |||
Reference types are created with classes. Value types are created with structs. | |||
==Platform Invoke== | ==Platform Invoke== | ||
[https://docs.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke Reference]<br> | [https://docs.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke Reference]<br> | ||
Platform Invoke (or P/Invoke) allows you to call and use C and C++ libraries from within your C# or other .NET programs. | Platform Invoke (or P/Invoke) allows you to call and use C and C++ libraries from within your C# or other .NET programs. | ||
[[Category:Programming languages]] |