Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void tokenize (char * source, char ** tokens, int & size_of_tokens)
- {
- char * token = strtok(source, " ,.!?:-\\\t");
- int size = 0;
- while (token)
- {
- bool found = false;
- for (size_t i=0; i<size; i++)
- {
- if (strcmp(token,tokens[i]) == 0)
- found = true;
- }
- if (!found)
- {
- strcpy (tokens[size], token);
- size++;
- }
- token = strtok(NULL, " ,.!?:-\\\t");
- }
- size_of_tokens = size;
- }
- int common_symb_in_order_cnt (char * str1, char * str2, size_t len)
- {
- int cnt = 0;
- for (int i=0; i<len; i++)
- {
- if (str1[i]==str2[i])
- cnt++;
- }
- return cnt;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement