April 2013
Intermediate to advanced
1700 pages
92h 51m
English
Besides constructors, C# has the notion of destructors. Before going any further, let’s start with the mandatory warning. In the world of garbage collection, destructors only share their name with the concept known from C++. That is, they are totally different in behavior, despite their common syntax. To put this straight, consider the following piece of C++ code. Readers unfamiliar with C++ can skip the following example:
#include <stdio.h>class Destruct{public: Destruct() { printf("Constructing\n"); } ~Destruct() { printf("Destructing\n"); }};void Stack() { printf("Stack - begin\n"); Destruct d; printf("Stack - end\n");}void Heap() { printf("Heap - begin\n"); Destruct ...
Read now
Unlock full access