gpt4 book ai didi

c - 参数列表不完整的 printf()

转载 作者:太空宇宙 更新时间:2023-11-04 02:02:38 24 4
gpt4 key购买 nike

我在解决 C 编程问题时遇到了这个问题

#include<stdio.h>
int main()
{
int x=100,y=200,z=300;
printf("%d..%d..%d");
}

我预计会出现错误,但输出是 300..200..100

谁能解释这个输出?

最佳答案

printf 中的

%d 需要 int 类型参数。你没有传递任何论点。它违反了约束,最终您的程序会调用未定义的行为

关于c - 参数列表不完整的 printf(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25136736/

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