I have a struct as follows:
struct temp
{
char* person;
char* address;
int id;
int phone;
}
And I have a struct variable as
temp var;
I wish to initialize the member of the structs in a constructor like:
Data ( )
{
var -> person = {};
var -> address = {};
var.id = 0;
var.phone = 0;
..............
}
person and address are char arrays.
I am not sure if that is the correct way to initialize them in C++. Any suggestions ?