Home > Software engineering >  About the addr. Sin_addr. S_un. S_addr small problems
About the addr. Sin_addr. S_un. S_addr small problems

Time:11-25

Char IP [32]="";
Printf (" please enter the address of the server: ");
The scanf (" % s ", & amp; IP);
Addr. Sin_family=AF_INET
Addr. Sin_addr. S_un. S_addr=inet_addr (" & amp; IP ");
Addr. Sin_port=htons (10086);
This program pass, put the addr travels & amp; IP into normal can through the IP address, ask bosses how to return a responsibility, how to change if you want to change

CodePudding user response:


Direct transfer IP can pass an array name

CodePudding user response:

IP is a string type, can use dotted decimal format, such as 192.168.1.1

CodePudding user response:

Inet_addr (IP);

CodePudding user response:

Dizzy, "& amp; IP is a "content for & amp; IP string, & amp; IP is the IP address??
The difference is one is: "& amp; IP ", one is "192.168.1.1"

CodePudding user response:

Why do you want to use & amp; IP? The direct use of IP

CodePudding user response:

And, you incredibly still put & amp; IP use quotation marks,,,,,,,, are you a beginner
  • Related