I'm writing a program in c in which I need to change the value of a variable from within a function. I've tried setting the variable globally but it was not recognized withinn the function so I tried the following: the variable is nobuttons:
readconfig(config2,&nobuttons);
void readconfig(FILE *config, int *buttons)
{
buttons=5;
}
when I print the value of buttons, it's shown as 0(the value it was initialized to)
what am I doing wrong? thanks
Aucun commentaire:
Enregistrer un commentaire