0

I have a C++ class with a double data type as a member variable. I want to initialize the variable during the declaration time. I am wondering which is the correct/better way to implement it:

class foo
{
    double first-method{0};
    double second-method{0.0};
};

Looks to me that both should work just fine. But what is the harm in clearing the concept by putting it out here instead of obsessing over it.

DonBaka
  • 325
  • 2
  • 14

0 Answers0