Answer the question
In order to leave comments, you need to log in
What would such C++ code look like?
class Hello:
def message(self):
return "Hello user!"
hello = Hello()
print(hello.message())
Answer the question
In order to leave comments, you need to log in
#include <iostream>
#include <string>
class Hello {
public:
std::string message() {
return "Hello, user!";
}
};
int main()
{
Hello hello;
std::cout << hello.message();
return 0;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question