* versus ^ allocation opperators
Tue Jun 28 2022 14:21:59 GMT+0000 (Coordinated Universal Time)
The caret '^' acts simarly to the '*' in C/C++ when declaring a type; I use the term 'pointer' when describing the managed object as a managed object can be compared to 'nullptr' just like a pointer in C/C++. A reference in C/C++ can not be compared to 'nullptr' as it is the address of an existing object. Managed objects use automatic-reference-counting meaning that they are destroyed automatically when they have a reference count of zero although if two or more unreachable objects refer to eachother, you will still have a memory leak. Be warned that automatic reference counting is not free performance wise so use it wisel
https://stackoverflow.com/questions/202459/what-is-gcnew
Comments