我正在移植使用 <unistd.h>
的 Linux 代码,特别是 gethostid 函数,适用于 Windows 7。
我需要将在我的应用程序中使用的唯一编号的 32 位。如何以与在 Linux 上相同的方式使用 Windows 7 中的 API 获取唯一编号?
谢谢。
最佳答案
您通常会通过返回本地 IP 地址来实现这一点,例如通过调用 getaddrinfo()
.
关于c++ - 如何在 Windows 7 上获取 gethostid 行为?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5333220/