parameterless constructer hypothetical

A sample problem I've become stuck on....


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?

I can't seem to determine the fault in this
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

FlashDrive() = default;
What would be the problems one might run into when working with a class that has no a trivial default constructor?
I do not know.:) Ask your professor.
Topic archived. No new replies allowed.