Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.36 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <ctype.h>
  4. #include <string.h>
  5. #include <stdlib.h>
  6. #include <math.h>
  7. #include <progbase.h>
  8. #include <progbase/console.h>
  9. #include <time.h>
  10. #include <stdbool.h>
  11. #include <assert.h>
  12. struct Sentence
  13. {
  14.     int indexOfStart;
  15.     char string[100];
  16. };
  17. struct SentenceArray
  18. {
  19.     struct Sentence *sentences;
  20.     int numOfSentences;
  21. };
  22. int firsSym2ndSent(char txt[]);
  23. void frstSentence(char txt[], int len, char buff[len]);
  24. int compareSentence(struct Sentence frstSentence, struct Sentence scndSentence);
  25. int comapreSentenceArray(struct SentenceArray frstArray, struct SentenceArray scndArray);
  26. struct Sentence firstSentence(const char * str);
  27. struct SentenceArray * getAllSentencesArrayNew(const char * str);
  28. int main(int argc, char *argv[])
  29. {
  30.     char string[] = "Hey buddy, I think you've got the wrong door, the leather club's two blocks down. Fuck↗You↘";
  31.     struct Sentence sent = firstSentence(string);
  32.     assert(sent.indexOfStart == 0 && strcmp("Hey buddy, I think you've got the wrong door, the leather club's two blocks down", sent.string) == 0);
  33.     char str[] = "     Hey buddy, I think you've got the wrong door. Fuck↗You↘";
  34.     struct Sentence sentnence2 = firstSentence(str);
  35.     assert(sentnence2.indexOfStart == 5 && strcmp("Hey buddy, I think you've got the wrong door", sentnence2.string) == 0);
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement