Windows winsocket2 addrinfo声明
我在理解Microsoft winsock2教程中的一个示例时遇到了一些困难 会Windows winsocket2 addrinfo声明,windows,pointers,winsock,variable-declaration,Windows,Pointers,Winsock,Variable Declaration,我在理解Microsoft winsock2教程中的一个示例时遇到了一些困难 会 struct addrinfo *result = NULL, *ptr = NULL, hints; 一模一样 struct addrinfo* result = NULL; struct addrinfo* ptr = NULL; struct addrinfo hints; 我假设这会创建两个指向类型为addrinfo的对象的指针result
struct addrinfo *result = NULL,
*ptr = NULL,
hints;
一模一样
struct addrinfo* result = NULL;
struct addrinfo* ptr = NULL;
struct addrinfo hints;
我假设这会创建两个指向类型为addrinfo
的对象的指针result
和ptr
,将它们赋值为NULL,并创建一个名为提示的类型为addrinfo
的对象,对吗?是。这:
struct addrinfo *result = NULL,
*ptr = NULL,
hints;
这是:
struct addrinfo* result = NULL;
struct addrinfo* ptr = NULL;
struct addrinfo hints;
代表相同的事物