Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ポートを SOCKADDR_IN 構造体に書き込む場合、htons(80) の代わりに 0x5000 を使用できますか?
(なぜ 0x5000 なのですか? -- htons(80) をデバッグしたところ、0x5000 が返されました)
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).
htons