Parallel arrays in C question: I need to use parralel arrays to count how many time a word appears in a text that would be read into the program. I need to also read in the file one character at a time. I can\'t use fscanf, fgets, putchar, sprintf, sscanf, getline, strncpy, strncat, strchr, strcspn, strspn, strstr, strtok, memcpy, memmove, memcmp, memset.
 I can however make my own versions of strcpy, strcat, and strlen.
 
 Basically I think I need to do this:
 -First I need to read in a file character by character (would I use fgetc? Would that basically be the same thing as using fgets?) into one array
 
 -While it\'s doing this, I guess it needs to know what is and isn\'t a word, and I also want to make sure capital letters don\'t interfere, so I would use islower. So the second array would be counting how many times that word shows up.
 
 Then I would like to bubblesort the results from most to least and print the results out.
 
 
 I feel like I\'m forgetting something, but I\'m not positive- does this look like this approach would work? Also would I even want to create my version for strcpy, strcat, and strlen since I can\'t use those already made ones?
 
    Parallel arrays in C question: I need to use parralel arrays to count how many time a word appears in a text that would be read into the program. I need to also read in the file one character at a time. I can\'t use fscanf, fgets, putchar, sprintf, sscanf, getline, strncpy, strncat, strchr, strcspn, strspn, strstr, strtok, memcpy, memmove, memcmp, memset.
 I can however make my own versions of strcpy, strcat, and strlen.
 
 Basically I think I need to do this:
 -First I need to read in a file character by character (would I use fgetc? Would that basically be the same thing as using fgets?) into one array
 
 -While it\'s doing this, I guess it needs to know what is and isn\'t a word, and I also want to make sure capital letters don\'t interfere, so I would use islower. So the second array would be counting how many times that word shows up.
 
 Then I would like to bubblesort the results from most to least and print the results out.
 
 
 I feel like I\'m forgetting something, but I\'m not positive- does this look like this approach would work? Also would I even want to create my version for strcpy, strcat, and strlen since I can\'t use those already made ones?
 
   Parallel arrays in C question: I need to use parralel arrays to count how many time a word appears in a text that would be read into the program. I need to also read in the file one character at a time. I can\'t use fscanf, fgets, putchar, sprintf, sscanf, getline, strncpy, strncat, strchr, strcspn, strspn, strstr, strtok, memcpy, memmove, memcmp, memset.
 I can however make my own versions of strcpy, strcat, and strlen.
 
 Basically I think I need to do this:
 -First I need to read in a file character by character (would I use fgetc? Would that basically be the same thing as using fgets?) into one array
 
 -While it\'s doing this, I guess it needs to know what is and isn\'t a word, and I also want to make sure capital letters don\'t interfere, so I would use islower. So the second array would be counting how many times that word shows up.
 
 Then I would like to bubblesort the results from most to least and print the results out.
 
 
 I feel like I\'m forgetting something, but I\'m not positive- does this look like this approach would work? Also would I even want to create my version for strcpy, strcat, and strlen since I can\'t use those already made ones?
 
Yes you need to read in a file character by character.
 Yes you can do it with the help of fgetc.
 There is only one difference between fgetc and fgets which is when the end of line occurs fgets returns NULL while fgetc returns EOF because these are the functions with different return types.
 This code will work:
 #include <iostream>
 #include <fstream>
 #include <iomanip>
 using namespace std;
 int main()
 {
 char c;
 int indexval,i;
 int count[26] = {0};
 ifstream infile(\"input.txt\"); //Enter your file name
 if (!infile)
 {
 cout << \"Unable to open file\";
 return 0;
 }
 while (infile.get(c)) // will read characters one at a time
 {
 if (isalpha(c)) // check if the character is a-z or A-Z
 {
 c = toupper(c); // change every character to upper case
 indexval = c - \'A\'; // indexval will come under range 0 to 25
 count[indexval]++;
 }
 }
 for (i=0; i<26; i++)
 {
 cout << char(i+\'A\') << \"present\" << setw(5) << count[i] << \"number of times\" << endl;
 }
 return 0;
 }