How can I connect nodes by C++ or Blueprint?

Would you please share how to do it in c++? I’m having the same problem, thanks.