turboc++ - Unexpected input from turbo c++ emulator using DOSBox -
#include <iostream.h> #include <conio.h> void main(){ float a,b,c; clrscr(); cout<<"enter , b "; cin>>a>>b; c=a+b; cout<<a<<"+"<<b<<"="<<c; getch(); }
upon running this:
i did digging debugger , input never received.
why happening
my guess there's in keyboard buffer feeds garbage data cin
.
try while(kbhit()) getch();
before cin>>a>>b;
, let me know if helps.
Comments
Post a Comment