1

私は次のプログラムを持っています

main()
{
   char a,b;
   printf("will i get the job:");
   scanf("%c",&a);
   printf("%c",a);
   printf("We did it");
}

としてファイルを保存しましたHope.c。上記のコードを gcc コンパイラでコンパイルしようとすると、次のエラーが発生します。

Hope.c:In function 'main':
Hope.c:4:2:warning:incompatible implicit declaration of built-in function 'printf' [enabled by default]          
Hope.c:5:2:warning:incompatible implicit declaration of built-in function scanf[enabled by default]

printf()orを使用するscanf()と、単純な「Hello world」プログラムであっても、コンパイラはこのエラーを返します。

私のコードに何か問題がありますか、それともコンパイラに問題がありますか?

4

4 に答える 4