Hi, I need help writing a program that allows you to read an English-French dictionary into two arrays. The English words are stored in one file alphabetically while the French words are stored in the other file corresponding to the English words. This means that the program would ask the user to type a random word and then it would print its French equivalent. The dictionary has to store up to 50 words and use the following function prototypes:
int read_in(char[][Word Length], char[][Word Length]);
void sort_words(char[][Word Length], char[][Word Length], int);
void search_words(char[][Word Length],char[][Word Length], int);
void write_out(char[][Word Length],char[][Word Length], int);
I'm using Word Length equals to 30. This is what I have so far:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
const int max_word_len = 30;
int read_in(char[][max_word_len], char[][max_word_len]);
void sort_words(char[][max_word_len], char[][max_word_len], int);
void search_words(char[][max_word_len],char[][max_word_len], int);
void write_out(char[][max_word_len],char[][max_word_len], int);
int main ()
{
const int max_word_count = 50;
char english[max_word_count][max_word_len];
char french[max_word_count][max_word_len];
int word_count = read_in(english, french);
string line;
ifstream myfile;
ofstream outfile;
myfile.open("English.txt");
if (myfile.is_open())
{
while (myfile.good())
{
getline (myfile,line);
cout<<line<<endl;
}
myfile.close();
}
else cout << "Unable to open the file";
return 0;
}
I know it's not complete, I'm trying to tackle each function one at a time but I'm sure how to proceed next. I would appreciate any help. Thank you.