Error with costructor without params

This is probably a very stupid question but..
i have a class with two constructor, one takes one parameter, the other takes no parameters:

MD23::MD23(byte address)
  _address = address;

  _address = DEF_ADDRESS;

Now, if i create the object like this:

MD23 md23(0x58);

It works perfectly, but if i write:

MD23 md23();

then whenever i call a method i have the following error:
error: request for member 'setMode' in 'md23', which is of non-class type 'MD23 ()()' In function 'void loop()':

I don't really get this error.. but i'm sure is something stupid :slight_smile:

If you want to use the default constructor, don't put parentheses after the name of the variable. That is, use:

MD23 md23;


MD23 md23();

The latter actually creates a pointer to a function of no parameters that returns an MD23.

Ah that explains all!
Thanks mellis :slight_smile: