C++ request for member ‘’ in ‘’, which is of non-class type ‘’

Rectangle s();

is a function declaration rather than variable. In c++ anything that can be parsed as a function declaration takes that parsing over the variable alternative. Removing the () would make it a variable.

Leave a Comment