Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

why use fflush(stdin) in C programming language?

OpenStudy (e.mccormick):

You don't. I have answered this about 20 times. Just Google it There are lots of documents on why it breaks things.

OpenStudy (anonymous):

int i=0; gotoxy(15,15); printf("Enter password:"); gotoxy(15,16); printf("***************"); gotoxy(30,15); while(ch!=13)// 13 ascii code for enter {ch=getch(); if(ch!=13) {putch('*'); pass[i]=ch; i++; }} pass[i]='\0'; if(strcmp(pass,Password)==0) { gotoxy(40,16); printf("password matched"); Sleep(2000); system("cls"); main_menu();} else {system("cls"); gotoxy(15,18); printf("Wrong password"); char p; gotoxy(15,19); printf("Do you want to re-enter password(Y/N):"); p=getche(); if(p=='Y') {system("cls"); password(); } else exit(0); } }plz explain the func \

OpenStudy (e.mccormick):

Well, what part of it are you having trouble with? Also, this looks like incomplete code.

OpenStudy (anonymous):

yes thz is only password func i want to ask that why we do pass[i]=NULL outside the loop why n t inside

OpenStudy (e.mccormick):

It is a null terminated string. Inside the loop you are doing the string. Outside, you terminate with a null.

OpenStudy (anonymous):

ok thanks for ur concern :-)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
1 day ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
1 day ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!