How to attach ActorComponent to my Actor in C++

USphereComponent* SphereComponent = CreateDefaultSubobject(TEXT(“RootComponent”));

look for more details here
https://docs.unrealengine.com/latest/INT/Programming/Tutorials/Components/1/