Sonar Sonar();
This is a prototype for a function called Sonar that takes no parameters and returns a class Sonar object.
If you really want an instance if class Sonar that is called Sonar, use
Sonar Sonar;
Sonar Sonar();
This is a prototype for a function called Sonar that takes no parameters and returns a class Sonar object.
If you really want an instance if class Sonar that is called Sonar, use
Sonar Sonar;