なし整数からポインタになり、私は本当に新しいCと私はCに次のコードを実行しようとしています:「のprintf」のキャスト
#include <stdio.h>
int main()
{
unsigned long i = 1UL << 2;
int j = (i==4);
printf('%d', j);
return 0;
}
しかし、それはエラーを与えている:
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, ...);
を
私はここで何が間違っているのか分かりません。どんな助け?
一重引用符。文字列 "%d"には二重引用符を使用してください。 – phoxis