#include <stdio.h>
#define MAX_SIZE 1000
void GetFile(char text[MAX_SIZE]);
main()
{
int index = 0; /* Index through the entire file */
int count = 0; /* Holds the number of matches */
char find; /* Character to search for */
char text[MAX_SIZE]; /* Input character file */
GetFile(text);
printf("Please input a character to search for :");
scanf("%c", &find);
/* Scan the file */
while (text[index] != '\0') {
if (text[index] == find)
count++;
index++;
}
/* Print out the results */
printf("The number of occurrences of %c is %d\n", find, count);
}