fork download
  1. #include <stdio.h>
  2.  
  3. void lueckeSchliessen(char *str) {
  4. int schritt = 0;
  5.  
  6. while(*(str + schritt + 1) != '\0') {
  7.  
  8. *(str + schritt) = *(str + schritt + 1);
  9.  
  10. schritt++;
  11. }
  12.  
  13. *(str + schritt + 1) = '\0';
  14.  
  15. }
  16.  
  17. /*
  18.  * str zeigt auf erstes Element des char-Array
  19. */
  20. void umwandlung(char *str) {
  21. // Ermittlung der zu ersetzenden Positionen, also Umlaute
  22.  
  23. int schritt = 0;
  24.  
  25. while(*(str+schritt) != '\0') {
  26.  
  27. if(*(str+schritt+1) == '\0') {
  28. break;
  29. }
  30.  
  31. // Detektion auf Umlaut ae
  32. if(*(str + schritt) == 'a') {
  33.  
  34. if(*(str + schritt + 1) == 'e') {
  35. printf("\nae gefunden!");
  36. *(str + schritt) = 'A';
  37. lueckeSchliessen(*(str + schritt + 1));
  38. }
  39.  
  40. schritt++;
  41. }
  42. }
  43.  
  44.  
  45. int main(void) {
  46. char *testString = "Uebergrosse Fuesse sind aergerlich";
  47.  
  48. printf("\ntestString (vorher): %s", testString);
  49.  
  50. umwandlung(testString);
  51.  
  52. printf("\ntestString (nachher): %s", testString);
  53.  
  54.  
  55. // your code goes here
  56. return 0;
  57. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘umwandlung’:
prog.c:37:22: warning: passing argument 1 of ‘lueckeSchliessen’ makes pointer from integer without a cast [-Wint-conversion]
     lueckeSchliessen(*(str + schritt + 1));
                      ^
prog.c:3:6: note: expected ‘char *’ but argument is of type ‘char’
 void lueckeSchliessen(char *str) {
      ^~~~~~~~~~~~~~~~
prog.c:45:5: warning: ‘main’ is normally a non-static function [-Wmain]
 int main(void) {
     ^~~~
prog.c:57:1: error: expected declaration or statement at end of input
 }
 ^
At top level:
prog.c:45:5: warning: ‘main’ defined but not used [-Wunused-function]
 int main(void) {
     ^~~~
stdout
Standard output is empty