How to call a function from another c++ class

I tried making my function public but now it says public void is a syntax error. What’s going on now? The header for the method simply says:

public void AMyOtherActor::SomeFunction() {