Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- #include <stdlib.h>
- #include <math.h>
- #include <progbase.h>
- #include <progbase/console.h>
- #include <time.h>
- #include <stdbool.h>
- #include <assert.h>
- struct Sentence
- {
- int indexOfStart;
- char string[100];
- };
- struct SentenceArray
- {
- struct Sentence *sentences;
- int numOfSentences;
- };
- int firsSym2ndSent(char txt[]);
- void frstSentence(char txt[], int len, char buff[len]);
- int compareSentence(struct Sentence frstSentence, struct Sentence scndSentence);
- int comapreSentenceArray(struct SentenceArray frstArray, struct SentenceArray scndArray);
- struct Sentence firstSentence(const char * str);
- struct SentenceArray * getAllSentencesArrayNew(const char * str);
- int main(int argc, char *argv[])
- {
- char string[] = "Hey buddy, I think you've got the wrong door, the leather club's two blocks down. Fuck↗You↘";
- struct Sentence sent = firstSentence(string);
- 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);
- char str[] = " Hey buddy, I think you've got the wrong door. Fuck↗You↘";
- struct Sentence sentnence2 = firstSentence(str);
- assert(sentnence2.indexOfStart == 5 && strcmp("Hey buddy, I think you've got the wrong door", sentnence2.string) == 0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement