jincast90
March 4th, 2007, 08:50 AM
Hello. I have written this following piece of code:
#include <stdio.h>
int main()
{
char key;
puts("Type your favorite keyboard character");
scanf("%c",&key);
printf("Your favorite character is %c!\n",key);
return(0);
}
After trying to compile using this command: "gcc favkey1.c -o favkey1" I get the following error:
favkey1.c:1:19: error: stdio.h: No such file or directory
favkey1.c: In function ‘main’:
favkey1.c:8: warning: incompatible implicit declaration of built-in function ‘scanf’
favkey1.c:9: warning: incompatible implicit declaration of built-in function ‘printf’
Can anyone tell me what is wrong in my source code?
#include <stdio.h>
int main()
{
char key;
puts("Type your favorite keyboard character");
scanf("%c",&key);
printf("Your favorite character is %c!\n",key);
return(0);
}
After trying to compile using this command: "gcc favkey1.c -o favkey1" I get the following error:
favkey1.c:1:19: error: stdio.h: No such file or directory
favkey1.c: In function ‘main’:
favkey1.c:8: warning: incompatible implicit declaration of built-in function ‘scanf’
favkey1.c:9: warning: incompatible implicit declaration of built-in function ‘printf’
Can anyone tell me what is wrong in my source code?