gpt4 book ai didi

c - 为什么我在 xcode 中使用 '\a' 没有听到哔哔声?

转载 作者:行者123 更新时间:2023-12-04 05:15:15 25 4
gpt4 key购买 nike

据我了解,在 printf 参数中使用\a 假设会发出警报声:
我在做printf("\a");但是得到一个倒置的问号……有人可以告诉我为什么吗?

最佳答案

据我所知,\a使用 PC 在启动时发出哔哔声的硬件扬声器等。也许 Mac 没有这个?

来自 http://en.wikipedia.org/wiki/Bell_character :

Modern terminal emulators often integrate the warnings to the desktop environment (e.g., the Mac OS X Terminal will play the system warning sound) and also often offer a silent visual bell feature that flashes the terminal window briefly.



您可以尝试从终端运行 exe 并查看是否会发生任何事情吗?

关于c - 为什么我在 xcode 中使用 '\a' 没有听到哔哔声?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14354096/

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