1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <stdio.h> struct test_class { test_class () { m = new char[10]; printf("In ctor\n"); } ~test_class () { delete m; printf("In dtor\n"); } char * m; } g; int main() { printf("In main\n"); return 0; }