   Function to find IP Address
  Is there a Windows function (I'm using winsock2 and c++) that a program to call to find that computer's IP address?I want the computer to call the function and display the address on the screen, so I need a way of determining what the address is so that I can convert it into a string.Thank you for your time.   
  something like this:sockaddr_in addr;int addrlen = sizeof(addr);getpeername(someSocket, (struct sockaddr *)&addr, &addrlen)char *ip = inet_ntoa(addr.sin_addr);Read MSDN for detailed information on these functions.   ;  getpeername() gets the address of the OTHER computer.You cannot, in general, get the address of the current computer your software is running on. Both because it may be multi-homed, and because of NAT.The Forum FAQ actually answers this very question (with some more pointers).;  the above is true but ignoring those casesThis is what i do after i connect using TCP    getsockname(this->mulSocket, (sockaddr*)&this->mLocalSocketAddress, &iSize);    mulLocalIP    = ntohl(this->mLocalSocketAddress.sin_addr.s_addr);    musLocalPort  = ntohs(this->mLocalSocketAddress.sin_port);   ;  ah i misread the question, my bad.   