Modernes C++ programmieren

Okt 23, 2024

lst-0233-book.cpp

struct Person {
    //… Rest wie zuvor 
    string gruss();
};
string Person::gruss() {
    return format("Hallo {} aus {}", this->name_, this->ort_);
}
int main() {
    Person anna { "Anna", 33, "Hof" };
    Person nina { "Nina", 22, "Wyk" };
    anna.gruss();
    nina.gruss();
}