Computer network course design notes

This blog records some unknown or forgotten questions in the computer course design process:

  1. 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

  2. \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".
    \r\n
    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.

Guess you like

Origin blog.csdn.net/weixin_43752257/article/details/111915233