nbd-client.c

...
int opennet(char *name, int port, int sdp) {
        int sock;
        char portstr[6];
        struct addrinfo hints;
        struct addrinfo *ai = NULL;
        struct addrinfo *rp = NULL;
        int e;

        snprintf(portstr, sizeof(portstr), "%d", port);

        memset(&hints,'\0',sizeof(hints));
...
}
....

I don't know why we use 'memset(&hints,'\0',sizeof(hints));', what
about 'memset(&hints,0,sizeof(hints));' instead? I usually use
'memset(&hints,0,sizeof(hints));' to initialize these memory. Cloud
anyone tell me the difference beween these two methods? Actually
i think '\0' is a terminal character of an array, right?

-- 
Thanks
Harry Wei

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Nbd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nbd-general

Reply via email to