Thread: calling menu problem
hi, have following code. wrong declaration.
getting deprecated conversion string constant char *
int getchoice(char *greet, char *choices[]);
char *main_menu[] = {
"choice 1",
"choice 2",
"choice 3",
0,
}; // error here...
int main()
{
int choice;
choice = getchoice("options: ", main_menu);
return 0;
}
int getchoice(char *greet, char *choices[])
{
// function codes here...
}
here's suggestions:
code:... int getchoice(const char *greet, const char *choices[]); const char *main_menu[] = { ... }; int getchoice(const char *greet, const char *choices[]) { // function codes here... }
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk calling menu problem
Ubuntu
Comments
Post a Comment