error: 'count' was not declared in this scope & error: 'Pals' was not declared in this scope
I try to make a program like the one in this book and write it the same #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> int count; int Pals; int search() { char querystring[50]; int choice; int d,m,y; int i=-1; printf("1. Search by name"); printf("2. Search by phone"); printf("3. Search by email"); printf("4. Search by birthdate"); printf("Enter you choice [1-4] :"); scanf("%d",&choice); switch(choice) { case 1:printf("Enter name to search :"); fflush(stdin); gets(querystring); for(i=0;i<count;i++) if(strcmpi(Pals[i].name,querystring)==0) break; break; case 2:printf("Enter phone to search :"); fflush(stdin); gets(querystring); for(i=0;i<count;i++) if(strcmpi(Pals[i].phone,querystring)==0) break; break; case 3:printf("Enter email to search :"); fflush(stdin); gets(querystring); for(i=0;i<count;i++) if(strcmpi(Pals[i].email,querystring)==0) break; break; case 4:printf("Enter birthdate to search :"); scanf("%d%d%d",&d,&m,&y); for(i=0;i<count;i++) if(Pals[i].bday.day == d && Pals[i].bday.month == m && Pals[i].bday.year == y) break; break; } return i; }