Guest User

Untitled

a guest
Jul 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. char *literals(char *s) {
  2. char array[10];
  3. int elements = 0;
  4. while (*s != '\0') {
  5. char c = *s;
  6. s++;
  7.  
  8. if (c != 'V' && c != 'v' && isalpha(c) != 0) {
  9. if (check_existing(c, array, elements) == 0) {
  10. array[elements] = c;
  11. elements++;
  12. }
  13. }
  14. }
  15.  
  16. char *literals;
  17. literals = malloc(elements);
  18. int i;
  19. for(i = 0; i < elements; i++) {
  20. literals[i] = array[i];
  21. }
  22. return literals;
  23. }
Add Comment
Please, Sign In to add comment