Zitat Zitat von shutdown Beitrag anzeigen
Das Beispiel ist ganz gut, nur wie funktioniert das ganze mit Arrays?
Wie mit Arrays? Das Beispiel ist doch mit Arrays?


Und nochmal zum Anfangsproblem:
Code:
int my_function(char string[])
{
  [...]
}
führt zu folgendem Compiler-Fehler: "expected ‘;’, ‘,’ or ‘)’ before ‘string’"

und
Code:
int my_function(char[] string)
{
  [...]
}
führt zu "array type has incomplete element type"
Die zweite Schreibweise ist definitiv falsch, die erste sollte hinhauen, evtl. ist da ein Fehler vor der Funktionsdefinition (poste doch mal den ganzen Code)?

Minimalbeispiel:
Code:
[...]
void func(char str*)
{
    printf("%s\n",str);
}

[...]
char *ptr="Hallo Welt";
char str[]="Hallo Welt";
func("Hallo Welt");
func(ptr);
func(str);
[...]