In C++, you have to be explicit about many things, like using delete. This gives the programmer more options, but, it doesn't always make sense to me. For example: initializing an array of characters in the constructor. Why aren't simple tasks like these can be handled easier than this way:
class x{
enum {Lim =20};
char a[Lim];
x(const char* s){
strncpy(a, s, Lim - 1);
a[Lim - 1] = '\0';
}
}
In, C#, all you have to do is:
class loai {
public char[] a;
public loai(char[] a) {
this.a = a;
}
}
P.S: Sorry for yesterday. I was tired and couldn't express my ideas well. Thanks