Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows winsocket2 addrinfo声明_Windows_Pointers_Winsock_Variable Declaration - Fatal编程技术网

Windows winsocket2 addrinfo声明

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

我在理解Microsoft winsock2教程中的一个示例时遇到了一些困难

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;
代表相同的事物