Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.77 KB | None | 0 0
  1. ////////// Read in Dictionary File + Populate 2d Character Arrays
  2.     FILE *dictionary;
  3.     dictionary = fopen("dictionary","r");
  4.    
  5.     if (dictionary == NULL){
  6.         puts("Dictionary file does not exist or could not be opened.");
  7.         return 0;
  8.     }
  9.    
  10.     while(1){
  11.         ch = fgetc(dictionary);
  12.         if (char == EOF){
  13.             break;
  14.         }
  15.        
  16.         if (isAmericanEnglish==0){
  17.             while(ch!=' ' && char!='\n'){
  18.                 //add character to the british array
  19.                 britishArray[x][y]=ch;
  20.                 y++;
  21.             }
  22.             //add '\0' to the end of the string
  23.             isAmericanenglish = 1;
  24.         }
  25.        
  26.         else if (isAmericanEnglish == 1){
  27.             while(char!=' ' && char!='\n'){
  28.                 //add character to the american array at index x;
  29.                 americanArray[x][y]=ch;
  30.                 y++;
  31.             }
  32.             //add '\0' to the end of the string
  33.             isAmericanEnglish = 0;
  34.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement