gpt4 book ai didi

c - unistd.h 库的 getopt() 函数

转载 作者:太空宇宙 更新时间:2023-11-04 06:16:47 25 4
gpt4 key购买 nike

我目前正在尝试制作我自己的 getopt() 函数版本。但我不知道它如何将字符类型返回为 int 类型。

有什么办法可以查看 getopt() 函数的源代码吗?

最佳答案

glibcgetopt() 的源代码在这里:https://github.com/lattera/glibc/blob/master/posix/getopt.c

当然,您可能会看到更多的实现方式,但这可能是最受欢迎的一种。这是另一个,来自 FreeBSD:https://github.com/lattera/freebsd/blob/master/lib/libc/stdlib/getopt.c

关于c - unistd.h 库的 getopt() 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43740149/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com