Following my last topic I have another question related somehow...
I now have this generic menu function declared like this:
And I call it with something like this:Code:int menu_function(char **menuops, int nOps);
Now, I need to create a new and different array of strings dynamically. I'm opening some directory and get all file names inside that directory (this is already done) and I want to add all those filenames into an array of strings much like menuops so later I can call menu_function with those filenames as menu options.Code:char *menuops[] = {"Option 1", "Option 2", "Option 3"}; int op = -1; op = menu_function(menuops, sizeof(menuops) / sizeof(char *));
If I have a variable declared like:
How can I build an array of strings into that variable?Code:char *menuops[];



LinkBack URL
About LinkBacks




)