"&"的问题
看下面代码:
hostent* pHostent = gethostbyname(hostname);
if (pHostent==NULL) {
printf("Error: %u\n", WSAGetLastError());
return -1;
}
hostent he = *pHostent;
printf("name=%s\naliases=%s\naddrtype=%d\nlength=%d\n",
he.h_name, he.h_aliases, he.h_addrtype, he.h_length);
我将hostent he = *pHostent;改为hostent &he = *pHostent;程序仍可以正常运行~~ &在这里是取址符么?
帮忙解释一下谢谢。