How to create TabbedComponent?

Hello, i am trying to understand how to work with TabbedComponent and i stuck in the beginning.
So, i am trying to create a TabbedComponent like this:

TabbedComponent tabComponent(TabbedButtonBar::Orientation::TabsAtTop);

And it is wrong. I saw in documentation and there is this line:

TabbedComponent (TabbedButtonBar::Orientation orientation)

I don’t understand, what am i doing wrong.

Also, i saw some information about it in forum and i found that i can create it like this:

TabbedComponent *tabComponent;
addAndMakeVisible(tabComponent = new TabbedComponent(TabbedButtonBar::TabsAtLeft));

But, can i create a TabbedComponent without pointer? And i dont feel the differense between creating a TabbedComponent with pointer and without, like i tried. So, can anyone explain to me, how to create it and what did i do wrong?
Thank you!

In your .cpp file:
MyTabbedComponent::MyTabbedComponent() :myTabs(TabbedButtonBar::Orientation::TabsAtLeft)

myTab is then declared in the class header as
TabbedComponent myTabs;

Google “C++ member initialization lists” for explanation !

@tomto66 Thank you! But it is a bit wierd…

What is weird please?