linux curl follow redirect

C++
curl -L google.com
Source

Also in C++: