Question: Can I get help translating this into pseudo code? Thank you #include #include #include int main() { FILE *fp, *fp1; int x; char line[100]; char
Can I get help translating this into pseudo code? Thank you
#include
int main() {
FILE *fp, *fp1;
int x; char line[100]; char words[100][50];
fp = fopen_s("keyword.txt", "r"); if (fp == NULL) { printf("Error opening file "); return 0; }
int count = 0; while (fgets(line, 100, fp) != NULL) { char *ch = strtok_s(line, ","); while (ch != NULL) { strcpy_s(words[count], ch); count++; ch = strtok_s(NULL, ","); } }
fclose(fp); fp = fopen_s("resume.txt", "r"); if (fp == NULL) { printf("Error opening file "); return 0; }
int count1 = 0; while (fgets(line, 100, fp) != NULL) { char *ch = strtok_s(line, " "); while (ch != NULL) { for (x = 0; x < count; x++) { if (strcmp(ch, words[x]) == 0) { count1++; } } ch = strtok_s(NULL, ","); } }
fclose(fp); printf("Total count of keywords is %d ", count1);
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
