Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////// Read in Dictionary File + Populate 2d Character Arrays
- FILE *dictionary;
- dictionary = fopen("dictionary","r");
- if (dictionary == NULL){
- puts("Dictionary file does not exist or could not be opened.");
- return 0;
- }
- while(1){
- ch = fgetc(dictionary);
- if (char == EOF){
- break;
- }
- if (isAmericanEnglish==0){
- while(ch!=' ' && char!='\n'){
- //add character to the british array
- britishArray[x][y]=ch;
- y++;
- }
- //add '\0' to the end of the string
- isAmericanenglish = 1;
- }
- else if (isAmericanEnglish == 1){
- while(char!=' ' && char!='\n'){
- //add character to the american array at index x;
- americanArray[x][y]=ch;
- y++;
- }
- //add '\0' to the end of the string
- isAmericanEnglish = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement