C++ syntax: Difference between revisions

Content deleted Content added
Line 564:
String name;
public:
MyClass(int x, const String& name):
x{x}, name{name} {}
 
int getX() const noexcept {
return x;
}
 
void setX(int newX) noexcept {
x = newX;
};
 
String getName() const noexcept {
return name;
}
 
void setName(const String& newName) noexcept {
name = newName;
}
};
}
</syntaxhighlight>