0
Why this code skips the line number:-14 and not giving the chance to input the data from user???
I couldn't find the sollution!!! https://code.sololearn.com/cwCgRyEEWFXu/?ref=app
6 Réponses
0
void setdata()
{
cout<<"Enter the name of product\n";
fflush(stdin); // <-- ###### do this. ########
getline(cin,name)
cout<<"Enter the Stock of product\n";
cin>>stock;
cout<<"Enter the price:-\n";
cin>>price;
0
Still not working
Output now:-
Enter the total item of Store
1
Enter the name of product
Enter the Stock of product
https://code.dcoder.tech/files/code/5e9f38bb84064c3004e40aa1/medical-shope
0
?? works fine in my IDE (code::blocks).
0
Oooo great!!!
At preasent i code on smartphone
that might be a reason
0
@Amit singh
Are you trying to run it in code playground?
If so...that might be reason.
0
Okkk
Thanks for replies you given!!!