1 2 3 4 5 6
|
struct my_struct {
int var1;
...
char[50] txt1;
my_struct(){txt1=""}
};
|
I'm unable to initialize txt1 to empty value....
Heeeelp
I need this, because when write to file I discover that I have uninitialized strange data.
Thanks
Last edited on
memset( txt1, 0, sizeof( txt1 ) );
char txt1[50] = {};
err whoops.. for a class,
1 2 3 4 5 6
|
struct my_struct {
int var1;
...
char txt1[50];
my_struct() : txt1() {} // use an initializer list
};
|
Last edited on