Advertisement
Shanix

Untitled

Mar 15th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. int checkLineForMisspelling( char *line )
  2. {
  3. char **wordsInLine = malloc( 100 * sizeof(char *) );
  4.  
  5. char *token = strtok (line, " ");
  6. int index = 0;
  7. while (token != NULL) {
  8. wordsInLine[index] = token;
  9. index++;
  10. token = strtok (NULL, " ");
  11. }
  12.  
  13. for ( int i = 0; i < index; i++ ) {
  14.  
  15. }
  16.  
  17. for (int i = 0; i < index; i++) {
  18. if ( isInDictionary( wordsInLine[i] ) ) {
  19. printf( "%s", wordsInLine[i] );
  20. } else {
  21. printf( "%s", markMisspelled( wordsInLine[i] ) );
  22. }
  23. // printf( "%s\n", wordsInLine[i] );
  24. }
  25.  
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement