struct bop
{
char fullname[ strSize ];
char title[ strSize ];
char bopname[ strSize ];
int preference;
};
int main()
{
bop *pn = new bop[ 3 ];
Is there a way to initialize the char array members all at once?
Edit: I know I can use string or vector but I just wanted to know out of curiosity.
If I’m not mistaken, you could add a constructor to the struct which initializes the values to default values. This is similar if not identical to what you use in classes.