fork(1) download
  1. #include <stdio.h>
  2. #include<string.h>
  3.  
  4. void RemoveDuplicates(char* str)
  5. {
  6. int a = 0,j,i = 0,k;
  7. while(str[a] != '\0')
  8. a++;
  9. while(str[i] != '\0')
  10. {
  11. j = i+1;
  12. while(str[j] != '\0')
  13. {
  14. if(str[i] == str[j])
  15. {
  16. k = j;
  17. while(str[k] != '\0')
  18. {
  19. str[k] = str[k+1];
  20. k++;
  21. }
  22. }
  23. else
  24. j++;
  25. }
  26. i++;
  27. }
  28. printf("%s",str);
  29. }
  30. int main() {
  31. //code
  32. int a;
  33. scanf("%d",&a);
  34. for(int i = 0;i<a;i++)
  35. {
  36. char str[i][];
  37. scanf("%s",str[i]);
  38. RemoveDuplicates(str);
  39. }
  40. return 0;
  41. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
2
geeksforgeek
acaaabbbacdddd
compilation info
prog.c: In function 'main':
prog.c:36:11: error: array type has incomplete element type 'char[]'
      char str[i][];
           ^
prog.c:36:11: warning: unused variable 'str' [-Wunused-variable]
stdout
Standard output is empty