I want to add component event in c++

You should be able to call the component function directly from the component instance.

replace UmyComponent & AMyActor names accordingly.

In custom component

in .h

UFUNCTION()
void MyCustomFunction(float passedParameter);

in .cpp

void UmyComponent::MyCustomFunction(float passedParameter){
}

in the header file of the actor you would need

UPROPERTY()
class UmyComponent * myCustomComponent;

example for a hypothetical cpp file of the actor

#include "myActor.h"
#include "myComponent.h"

// constructor
AMyActor::AMyActor(){
myCustomComponent = CreateDefaultSubobject<UmyComponent>(TEXT("my componenet"));

// call function when needed
myCustomComponent->MyCustomFunction(5.0f);


}