0

ポートを SOCKADDR_IN 構造体に書き込む場合、htons(80) の代わりに 0x5000 を使用できますか?

(なぜ 0x5000 なのですか? -- htons(80) をデバッグしたところ、0x5000 が返されました)

4

2 に答える 2

2

You can but it won't be portable. htons exists for you not to worry about byte ordering in your computer and network (and they can be different on various systems).

于 2013-04-01T19:02:11.883 に答える