I don't understand what is wrong with this C code. I am just asking this for learning purposes. I know the game is kind of stupid but it's just for fun and learning.
#include <stdio.h>
int main(){
int response
char name [20];
printf ("Welcome to Game1\n");
printf ("What's your name?\n");
scanf ("%s",name);
printf ("From now on you're Private %s\n",name);
printf ("Loading...\n");
delay(4000);
printf("You are in a army excersize yard.\n");
delay(4000);
printf("Your sargeant approaches.\n");
printf ("Sargeant Sam: Drop and give me twenty, Private %s\n",name);
printf ("1) Yessir!\n2)Make me\n");
scanf ("%d\n", response);
if(response==1){
printf ("You do 20 pushups\n");
}
if(response==2){
printf("Sargeant Sam: What did you say?!\n");
}
return (0);
}
These are the errors
game1.c: In function ‘main’:
game1.c:4: error: nested functions are disabled, use -fnested-functions to re-enable
game1.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘char’
game1.c:16: error: ‘response’ undeclared (first use in this function)
game1.c:16: error: (Each undeclared identifier is reported only once
game1.c:16: error: for each function it appears in.)
I am a complete beginner so please explain everything simply.