Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
344 B
3
Indexable
Never
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;
}