nochmal Arraypointerreferenztohuwabohu
hallo,
ich schleudere wieder bei Übergabe von arrays an Funktionen:
ich habe einen array of cstrings
Code:
char mlist0[6][11] = {"Titel","ESC ","Ja","Nein","foo","bas"};
und die folgende Funktion (in einer Klasse als Methode)
Code:
class tMenu {
private:
int MENULEN;
public:
char ** list;
void importlist ( char ** extlist ) {
int16_t N = MENULEN;
for(int line=0; line<N; line++) {
strncpy( list[line], extlist[line], strlen(extlist[line]) );
}
}
tMenu menu0(6,11);
//
ich will jetzt die Objekt-Methode aufrufen zum Initialisieren:
menu0.importlist(mlist0); // exit status 1 no matching function for call to 'tMenu::importlist(char [6][11])'
menu0.importlist(*mlist0); // exit status 1 no matching function for call to 'tMenu::importlist(char [11])'
menu0.importlist(**mlist0); // exit status 1 invalid conversion from 'char' to 'char**' [-fpermissive]
menu0.importlist(&mlist0); // exit status 1 no matching function for call to 'tMenu::importlist(char (*)[6][11])'
menu0.importlist((char**)mlist0); // => runtime error:
Exception ( 28 ):
epc1=0x40206204 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000030 depc=0x00000000
ich weiß nicht mehr, was ich jetzt sonst noch ausprobieren könnte... :confused: :confused: :confused: