![]() |
| | #1 |
| Intranasal Heroin User Join Date: Sep 2001 Location: Buffalo, NY
Posts: 1,033
| Weird gethostbyname() issue For example, Code: LPHOSTENT lphost = NULL;
LPHOSTENT lphost2 = NULL;
//assign lphost to the IP at www.microsoft.com
lphost = gethostbyname("www.microsoft.com");
//assign a different var, lphost2, to www.cnn.com
lphost2 = gethostbyname("www.cnn.com");
//Assign to the address of lphost...
client.sin_addr = *((LPIN_ADDR)*lphost->h_addr_list);
Thanks |
| Xterria is offline | |
| | #2 | ||
| carry on Join Date: Feb 2003 Location: Seattle, WA
Posts: 1,971
| Probably because it returns a pointer to a HOSTENT stucture. On msdn it says: Quote:
Quote:
__________________ "Think not but that I know these things; or think I know them not: not therefore am I short Of knowing what I ought." -John Milton, Paradise Regained (1671) "Work hard and it might happen." -XSquared | ||
| JaWiB is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Some weird issue. | dbzx | C Programming | 7 | 04-12-2009 04:10 PM |
| float calculation issue | George2 | C# Programming | 1 | 05-26-2008 04:56 AM |
| type safe issue | George2 | C++ Programming | 4 | 02-12-2008 09:32 PM |
| weird pointer issue | Chaplin27 | C++ Programming | 5 | 08-01-2006 09:20 AM |
| my first issue of GDM | DavidP | A Brief History of Cprogramming.com | 0 | 09-12-2002 04:02 PM |