30 lines
401 B
C++
30 lines
401 B
C++
// skeleton.cpp
|
|
|
|
#include <iostream>
|
|
|
|
class Person
|
|
{
|
|
std::string name;
|
|
|
|
public:
|
|
|
|
Person(std::string name)
|
|
{
|
|
this->name = name;
|
|
}
|
|
|
|
void greet()
|
|
{
|
|
std::cout << "Hello, my name is " << this->name << "!" << std::endl;
|
|
}
|
|
};
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
auto person = new Person("Madison");
|
|
person->greet();
|
|
delete person;
|
|
|
|
return 0;
|
|
}
|