Create a function named myMethod
with no return value. Then Use myObj
to call myMethod
inside main
.
class MyClass {
public:
@(4) @(8)() {
cout << "Hello World!";
}
};
int main() {
MyClass myObj;
@(5).@(8)();
return 0;
}
class MyClass {
public:
void myMethod() {
cout << "Hello World!";
}
};
int main() {
MyClass myObj;
myObj.myMethod();
return 0;
}