This blog records some unknown or forgotten questions in the computer course design process:
-
sprintf(sendBuf,"Welcome %s to here!",inet_ntoa(addrClient.sin_addr))
inet_ntoa This function receives in_addr type parameters, and then returns a string representing the IP address in dotted decimal format.
The role of sprintf here: connection string
detailed
-
\r\nWhat does it do? The difference between Unix, Windows and Mac systems: at the end of each line, Unix only has "<newline>", that is, "\n"; in Windows, it is "<carriage return><newline>", that is, "\r\n" ; In Mac system, it is "<Enter>", that is, "\r".
Baidu knows the address
3. Unsigned int d4:6 indicates that the variable d4 defined in the structure occupies 6 bits, that is, the bit width is 6.