i need to enter a character in a function, and then depending on what that character is, the function returns either A, B , P or # now. Before that function is ever called i need to enter a number. now my problem is , that the number that I enter seems to be passed to the function aswell. here's my code
char vnes(){
char pom;
printf("Vnesete vrednost za poleto: \n");
scanf("%c", &pom);
if (pom=='A') return 'A';
if (pom=='B') return 'B';
if (pom=='C') return 'C';
else return '#';
}
int main()
{
int n, pamtia, pamtib, provb=0, provcelo=1, i;
char pom;
scanf("%d", &n);
for (i=0; i<n; i++){
pom=vnes();
//rest of code not important
}
}
the first character is always # , even if I enter A , or B