Class C++ Arduino error: request for member

Hi all,

I don't speak english very vell but i don't understand why after compil Class Sonar. when I use de fonction
message : error: request for member 'Hr' in 'Sonar', which is of non-class type 'Sonar()'

It's a very very simple class but I d'ont understand :

#ifndef Clp_HC_SR04
#define Clp_HC_SR04

#include "Arduino.h"

class Sonar
{
public:
Sonar();

void Hr();

};

#endif

#include "Arduino.h"
#include "Clp_HC_SR04.h"

Sonar::Sonar()
{
pinMode(11,OUTPUT);
digitalWrite(12,LOW); // La broche TRIGGER doit être à LOW au repos
pinMode(12,INPUT);

}

void Sonar::Hr()
{

Serial.println (" sonar test ");

delay(500);
}

***************************** program ***********************
#include <Clp_HC_SR04.h>

Sonar Sonar();

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly
Sonar.Hr();

}

Sonar Sonar();

Don't try to create an instance of a class with the same name as the class.

Next time, use code tags.

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;

Hi oqibidipo ,

I am very happy , I had replace Sonar Sonar(); I replace by Sonar Sonar;

and it's good . the programm run.

very thanks ...... but I d'ont undertand the class of C++

regards