Sally The Programmer is working to improve a class called FlashDrive. She decides to make a parameterless constructor so that driver code can conveniently say:
FlashDrive f;
and have everything still compile and work properly. In her implementation of the parameterless constructor, she writes:
FlashDrive::FlashDrive() {
// empty...
}
In our book's practice problems we are asked what is wrong with her approach and what would you recommend she do to avoid potential problems?
Except that in this case the class has no a trivial default constructor I do not see any other problems.
If a class has no a trivial default constructor it is a non-trivial class. So it can not be for example a POD struct.
To make a trivial default constructor you should write