में fflush (stdin) के उपयोग क्या है मेरे पास है निम्नलिखित कार्यक्रमसी प्रोग्रामिंग
#include <stdio.h>
#include <stdlib.h>
int main()
{
char ans[8];
int i;
for(i=1;i<=3;i++)
{
printf("\n What is the unit of traffic ?");
scanf("%s",ans);
fflush(stdin);
if(stricmp(ans,"Earlang")==0)
{
printf("\nAnswer is correct");
exit(1);
}
else
if(i<3)
printf("\n Try Again!\n");
}
printf("\n Nunit of traffic is Earlang:");
}
इस कार्यक्रम में fflush (stdin) के उपयोग क्या है?
क्या आप दस्तावेज़ पढ़ने में असमर्थ हैं? –
@MitchWheat जैसा कि आपको पता होना चाहिए, बहुत से दस्तावेज़ों में 'fflush (stdin)' का उल्लेख नहीं किया जाएगा, क्योंकि इसमें केवल कुछ प्लेटफॉर्म पर परिभाषित व्यवहार है। इस पर पहले से परेशान होना बिल्कुल सामान्य है (लेकिन SO पर डुप्लिकेट प्रश्नों का एक टन होना चाहिए, उदाहरण के लिए [fflush (stdin) का उपयोग करना] (http://stackoverflow.com/questions/2979209/using-fflushstdin))। उपरोक्त प्रोग्राम में – Gilles