r/C_Programming • u/UsualLonely4585 • May 29 '26
Question HELP!!!!
while(1){
if(scanf(" %d",&input_choice)==1){
break;
};
while(1){
if(getchar()=='\n'){
break;
}
}
};
Guys what am i doing wrong can you please tell me .
i am sorry if i am asking very basic thing . i read some documentation online but couldn't figure out what is going wrong
0
Upvotes
View all comments
Show parent comment
1
u/UsualLonely4585 May 29 '26
Idk i thought since it takea out a char then if user input a string it needs to take out multiple char maybe i just dont understand how it works yet but thanks man