How to cast a variable to an Actor? C++

I am currently trying this solution, it the problem not solved I will post more detailed information and code