...
Code Block | ||||
---|---|---|---|---|
| ||||
int check_password(User *user, char *pw_given) {
if (!strcmp((user->password),pw_given)) {
return 1;
}
return 0;
}
void login(char *usr, char *pw) {
User user = find_user(usr);
if (!check_password(user, pw)) {
grantAccess();
}
denyAccess("Incorrect Password");
}
|
...
[StackOvflw 2009] "Should I return TRUE / FALSE values from a C function?
...
EXP21-C. Place constants on the left of equality comparisons03. Expressions (EXP)