So i have a program and the user is supposed to type in the method he wants used. For example if he types "p" it runs a method that has no parameters but he can also type "a 1 1 1.5" thats meant for another method with 2 ints a double as parameters. I was trying to use this:
Code:
char com;
int a, b;
double c;
scanf("%c %d %d %lf", &com, &a, &b, &c);
while(com != 'q'){
if(com == 'p'){
list(matrix);
}
else if(com == 'a'){
adds(a, b, c, matrix);
}
else if(com == 'i'){
carac(matrix);
}
scanf("%c %d %d %lf", &com, &a, &b, &c);
}
But he is not running to correct methods when i type the letter. When the user types "q" the program is supposed to end. Can anyone help me to find whatīs wrong?