#include "stdafx.h"//VC6.0的运行结果我不知道怎么回事,麻烦指点一下!!!
#include "D:\project\headfile\CInitSock.h"
#include "stdio.h"
CInitSock initSock;
int main(int argc, char* argv[])
{
char szHost[256];
::gethostname(szHost,256);
hostent *pHost=::gethostbyname(szHost);
in_addr addr;
for(int i=0;;i++)
{
char *p=pHost->h_addr_list[i];
if(p == NULL)
break;
memcpy(&addr.S_un.S_addr,p,pHost->h_length);
char *szIp=::inet_ntoa(addr);
printf("dddddd\n",szIp);
}
return 0;
}
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2_32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\secur32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2help.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\mswsock.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\dnsapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\winrnr.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wldap32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rasadhlp.dll', no matching symbolic information found.
The thread 0x96C has exited with code 0 (0x0).
The program 'D:\vc\MyProjects\Mytest\Debug\Mytest.exe' has exited with code 0 (0x0).
#include "D:\project\headfile\CInitSock.h"
#include "stdio.h"
CInitSock initSock;
int main(int argc, char* argv[])
{
char szHost[256];
::gethostname(szHost,256);
hostent *pHost=::gethostbyname(szHost);
in_addr addr;
for(int i=0;;i++)
{
char *p=pHost->h_addr_list[i];
if(p == NULL)
break;
memcpy(&addr.S_un.S_addr,p,pHost->h_length);
char *szIp=::inet_ntoa(addr);
printf("dddddd\n",szIp);
}
return 0;
}
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2_32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\secur32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2help.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\mswsock.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\dnsapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\winrnr.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wldap32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rasadhlp.dll', no matching symbolic information found.
The thread 0x96C has exited with code 0 (0x0).
The program 'D:\vc\MyProjects\Mytest\Debug\Mytest.exe' has exited with code 0 (0x0).
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货