Extracting IP address from a character array returned by ESP8266 module

Im learning as i go along.
If someone could tell me how to use all locals, passing in tag and returning value i would be over the moon.

I accept its not ideal at the moment, thats why i am on here asking for help.