Click here to Skip to main content
15,904,024 members
Please Sign up or sign in to vote.
1.00/5 (6 votes)
See more:
A C program to:
System should check if user is valid
If user is valid it should ask user whether he wants to know account balance, make fund transfer or update balance.
If user is not valid inform admin about unauthorized access.
If more than 3 wrong login attempts for user, then that account has to be locked.
Admin gets monthly reports of unauthorized access.

What I have tried:

Creating structure and some user authentication but didnt worked.
Want to create the project as database based using C. Any ideas on how to store the username and password in a file?

for(i=0;i<row;i++){
			if(strcmp(user.userName,userNames[i]) == 0 ){
				userType=2;
				break;
			}
		}
	}
	if(userType==1||userType==2){
		res = validatePassword(user.password);
	}
	printf("%d",userType);
	printf("\n%d",res);
}
int validatePassword(char passwd[]){
	return 1;
}
Posted
Updated 22-Oct-20 2:31am
v3
Comments
Richard MacCutchan 20-Oct-20 11:14am    
"but didnt worked."
Sorry, but we cannot guess what you did wrong. Please use the Improve question link above and add full details of what you have tried and what results you saw.
Dave Kreskowiak 20-Oct-20 11:40am    
If you've got a problem with your code, we'd have to see the relevant code you wrote and the details of the problem you're having.

Right now, as your "question" stands, it looks like you want someone to write your code for you and that's not going to happen.
[no name] 20-Oct-20 14:38pm    
That's a job / project, not a "question".
Richard MacCutchan 22-Oct-20 9:26am    
You have created an array of user names. But the requirement is to use the User struct. So create an array of User structs and initialise them with the relevant details. Then when a user tries to login you can check both username and password in the struct table. That will also give you immediate access to the account balance for users who pass the security check.
Member 14970483 22-Oct-20 11:03am    
THank you. WIll try that and ask back if I am unable to do so

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900