I am new to C language and I need help.
The Program will ask the user the account number and Account Pin. Then will search the File "Account.txt". If the Account Number and Pin are matched to what was written on the file then will display another Option, such as Balance inquiry,Deposit, withdrawal and Quit.
How can it be possible to search the file for a match? What exactly will I do?
Here's some code:
void OpenAnAccount() {
FILE * fptr;
fptr = fopen("Account.txt", "w");
if (fptr == NULL) {
printf("File does not exists \n");
}
printf("*************************************\n\n");
printf("\n ACCOUNT CREATION ");
printf("\n**********************************\n");
printf("Enter Your Account Number :\n");
scanf("%d", & acctno);
printf("Enter your Name:\n");
scanf("%s", & acctname);
printf("Enter your Account Pin: \n");
scanf("%d", & acctpin);
printf("Please Enter Your Initial Deposit :");
scanf("%f", & dep);
fprintf(fptr, "%d%s%d%f\n", acctno, acctname,
acctpin);
}
void BankTransactions() {
int AN, AP;
printf("Enter 5 digits Account Number :\n");
scanf("%d", & AN);
printf("Enter 4 digits Accoount Pin :\n");
scanf("%d", & AP);
}