why use fflush(stdin) in C programming language?
You don't. I have answered this about 20 times. Just Google it There are lots of documents on why it breaks things.
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 \
Well, what part of it are you having trouble with? Also, this looks like incomplete code.
yes thz is only password func i want to ask that why we do pass[i]=NULL outside the loop why n t inside
It is a null terminated string. Inside the loop you are doing the string. Outside, you terminate with a null.
ok thanks for ur concern :-)
Join our real-time social learning platform and learn together with your friends!