小编use*_*188的帖子

printf()的行为

#include <stdio.h>

int main()
{

    printf(5 + "Good Morning\n");

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

代码打印出晨.代码应该打印早上还是应该显示未定义的行为?

c printf

4
推荐指数
2
解决办法
174
查看次数

将中缀转换为后置修复表达式,关联性总是从左到右?

如果是,那为什么会这样呢?不正确的关联性对后缀表达有效吗?

c stack postfix-notation associativity

-2
推荐指数
1
解决办法
1692
查看次数

在C中printf()的意外行为

#include <stdio.h>

int main()
{
    short int a = 5;
    printf("%d" + 1, a);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

printf无论变量的值和类型如何,代码都会打印括在引号中的字母a.如果添加任何其他数字,除了1没有打印.为什么会这样?

c printf

-3
推荐指数
1
解决办法
258
查看次数

标签 统计

c ×3

printf ×2

associativity ×1

postfix-notation ×1

stack ×1