Untitled
unknown
plain_text
4 years ago
344 B
9
Indexable
class Style
{
const char* mText;
public:
Style(const char* text)
{
mText = text;
}
void hello()
{
cout << mText;
}
};
class Button
{
const char* text = "Hello World!";
public:
Style* style = new Style(text);
};
int main()
{
Button* btnLogin = new Button;
btnLogin->style->hello();
return 0;
}Editor is loading...