Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
MyMain.cpp:6: error: request for member 'mX' in 'w', which is of non-class type 'Widget()'
|
IDE: Qt Creator 1.3.1
Project type: Qt4 Console Application
Selected required modules: QtCore
The following code caused the error:
struct Widget{ int mX; }; |
Instanciate the default-constructed class without brackets:
struct Widget{ int mX; }; |
From [1]: 'The code does not declare a Widget named w, it declares a function named w that takes nothing and returns a Widget'.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.