gpt4 book ai didi

c - printf 格式参数包含未定义的转义字符

转载 作者:行者123 更新时间:2023-12-02 04:51:44 26 4
gpt4 key购买 nike

#include <stdio.h>

int main()
{
printf("Hello\c!\n");
return 0;
}

输出:你好!

那么,当 \[some_undifined_symbol] 出现在 printf 的格式字符串中时,它会忽略 \ 吗?

最佳答案

\c 不是已经定义的转义序列,但最好避免使用它,因为它是保留的:

C99 §6.11.4 Character escape sequences

Lowercase letters as escape sequences are reserved for future standardization. Othercharacters may be used in extensions.

关于c - printf 格式参数包含未定义的转义字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18718787/

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