gpt4 book ai didi

C : Converting all special char to the equivalent (é => e)

转载 作者:太空狗 更新时间:2023-10-29 15:22:52 25 4
gpt4 key购买 nike

我需要用 C 编写凯撒密码,所以我正在一步步地理解我正在做的一切。

我需要处理特殊字符示例:如果用户输入

“这是似曾相识的感觉!”它会将其转换为 “这是似曾相识”

是否有 C 函数能够执行此操作,而不用手动为 ASCII 代码中的每个特殊字符执行此操作?

这是我要避免的:

case -85 :
case -86 :
case -87 :
case -88 :
*p = 'e';

最佳答案

Is there a C function capable of doing this instead of doing it by hand for each special char in ASCII code ?

Iconv当您选择 ASCII//TRANSLIT 作为目标编码时,将会执行您想要的操作。

关于C : Converting all special char to the equivalent (é => e),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4071613/

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