Below are two variants of my program
struct customer{
char fullname[35];
double payment;
};
int main()
{
customer alex{"Alex", 15};
return 0;
}
struct customer{
char fullname[35];
double payment;
};
int main()
{
customer* alex = new customer {"Alex", 15};
return 0;
}
The first one works fine, but the second raises error:could not convert '{"Alex", 15}' from 'brace-enclosed initializer list' to 'customer'. What's the issue?