我有以下程序
main()
{
char a,b;
printf("will i get the job:");
scanf("%c",&a);
printf("%c",a);
printf("We did it");
}
Run Code Online (Sandbox Code Playgroud)
我把文件保存为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]
Run Code Online (Sandbox Code Playgroud)
当我使用printf()or时scanf(),编译器会出现此错误,即使在简单的"Hello world"程序中也是如此.
我的代码有问题,或者编译器有问题吗?