Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Dictionary::translate(char out_s[MAX_WORD_LEN], const char s[MAX_WORD_LEN])
- {
- int i = 0;
- for (i=0;i<numEntries;i++)
- {
- if (strcmp(englishWord[i], s)==0)
- break;
- cout << 1 << endl;
- }
- if(i<numEntries)
- {
- strcpy(out_s, elvishWord[i]);
- cout << 2 << endl;
- }
- else{
- string not_found;
- cout << 3 << endl;
- not_found = '*' + s + '*';
- cout << 4 << endl;
- strcpy(out_s, not_found.c_str());
- cout << 5 << endl;
- break;
- }
- // what do I do if I didn't find the word?
- // might want another parameter or return value what
- // indicates that the word wasn't found
- }
Advertisement
Add Comment
Please, Sign In to add comment