#include
using namespace std;
class MyClass
{
public:
void printInformation();
};
void MyClass::printInformation()
{
return;
}
int main(
On an informal note, you can also call non-static member functions on temporaries:
MyClass().printInformation();
(on another informal note, the end of the lifetime of the temporary variable (variable is important, because you can also call non-const member functions) comes at the end of the full expression (";"))