#include <stdio.h>
#include <stdlib.h>
int main ()
{
int a=2,*p;
p=&a;
printf ("address of a=%u", p);
return (0);
}
Ubuntu でこのコードを実行すると、次のエラーが出力されます。
format '%u' expects argument of type 'unsigned int',
but argument 2 has type 'int *' [-wformat].
本のコードでもこの種のエラーが発生するのはなぜですか? これがばかげた質問であることはわかっていますが、非常に混乱しています。