import core.stdc.stdio;
struct A{
static int e=40;
struct B{
int m;
this(int i){
printf("%i",e);m=i;
}
~this(){
e=m;
printf("%i",e);
}
}
void f(){
B b=e;e=6;
}
void g(){
printf("%i",e);
}
}
extern(C)void main(){
A a;
a.f();
a.g();
}
I want B
to become the following version similar to 'C++'. What should I do?
struct B{
int m;
B(){
printf("%i",e);m=e;
}
~B(){
e=m;
printf("%i",e);
}
}
Thank you.