| Kai Busuttil 02/28/10 15:36 Modified: 02/28/10 15:38 Read: 552 times Rabat Malta |
#173654 - Question about KEIL |
I have an assignment to write an application and build the circuit for a system based on the 8051 with keypad and LCD interfacing where the user enters a password, if the password matches the one stored then the LCD will display CORRECT. So far so good, the only bugger is that regardless of the password I input the password is always recognized as 'incorrect'.
Which leads me to the question: Is possible in Keil to compare two char array variables as follows?
//if user inputted password is not equal to the saved password then it's incorrect
if (password[cnt2] != passINP[cnt2]);
{
flag = 0;
}
Obviously this code snippet is within a for loop in my code. 'passINP' is a char array where I'm storing each keypress the user does on a keypad and 'password' is another char array where I'm storing a predefined password (12345678 in this case, each element holds a number). 'flag' is a bit variable where it's declared as 1 by default. Any help will be appreciated...(please no big spoon feeding, else it's not fun :) ) Thanks in advance. Kai |
| Topic | Author | Date |
| Question about KEIL | Kai Busuttil | 02/28/10 15:36 |
| It ain't how i would do it | Jez Smith | 02/28/10 15:57 |
| Thank you! | Kai Busuttil | 02/28/10 16:08 |
| using strncmp for a password check is a bug :^) | Frieder Ferlemann | 03/01/10 11:40 |
| Yeah whatever | Jez Smith | 03/01/10 15:14 |
| Interesting | Kai Busuttil | 03/01/10 17:58 |
| Eh?? | Andy Neil | 03/02/10 01:02 |
40 instead of 50000000 | Frieder Ferlemann | 03/02/10 13:17 |
| Nothing to do with Keil | Andy Neil | 02/28/10 16:20 |
| Hmmm I see | Kai Busuttil | 02/28/10 16:43 |
| Problem solved! | Kai Busuttil | 02/28/10 17:05 |
| Do you undrestand why it did not work? | Neil Kurzman | 03/01/10 00:10 |
| Wrong | Maarten Brock | 03/01/10 03:49 |
| Yes, it's wrong - but... | Andy Neil | 03/01/10 04:32 |
| code size decrease | Maarten Brock | 03/01/10 11:51 |
| Maybe | Andy Neil | 03/01/10 12:16 |
| After a nights sleep | Neil Kurzman | 03/01/10 13:21 |
| Where it gets specific to Keil (or whatever) | Andy Neil | 03/01/10 01:27 |
| Explain | Maarten Brock | 03/01/10 03:56 |
| Woops. | Kai Busuttil | 03/01/10 05:03 |
| such a 'newb' error (sic) | Andy Neil | 03/01/10 05:37 |
| Password application | Jez Smith | 03/02/10 10:54 |



