I need a function, which accept a host name and return the IP address of the same machine, and a function that performs opposite.

Are in Visual C++ such functions or have anyone an idea how to write them ?