我是一个真正的 C 新手,我正在尝试在 C 中运行以下代码:
#include <stdio.h>
int main()
{
unsigned long i = 1UL << 2;
int j = (i==4);
printf('%d', j);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
但它给出了错误:
prog.c: In function 'main':
prog.c:6:10: warning: multi-character character constant [-Wmultichar]
printf('%d', j);
^
prog.c:6:10: warning: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
In file included from prog.c:1:0:
/usr/include/stdio.h:362:12: note: expected 'const char * restrict' but argument is of type 'int'
extern int printf (const char *__restrict __format, ...);
Run Code Online (Sandbox Code Playgroud)
我不确定这里出了什么问题。有什么帮助吗?
| 归档时间: |
|
| 查看次数: |
9384 次 |
| 最近记录: |