how to use variables from other class in ue5 c++?

Yes then go → on the lines below.
He needs to create a handler first like you have shown where the pointer type is the class object.
He can get any class members this way that are in the allow section inside the header.