Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/28/10 21:36
Modified:
  02/28/10 21:38

Read: times


 
#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

List of 22 messages in thread
TopicAuthorDate
Question about KEIL            01/01/70 00:00      
   It ain't how i would do it            01/01/70 00:00      
      Thank you!            01/01/70 00:00      
      using strncmp for a password check is a bug :^)            01/01/70 00:00      
         Yeah whatever            01/01/70 00:00      
         Interesting            01/01/70 00:00      
         Eh??            01/01/70 00:00      
            40 instead of 50000000            01/01/70 00:00      
   Nothing to do with Keil            01/01/70 00:00      
      Hmmm I see            01/01/70 00:00      
         Problem solved!            01/01/70 00:00      
            Do you undrestand why it did not work?            01/01/70 00:00      
               Wrong            01/01/70 00:00      
                  Yes, it's wrong - but...            01/01/70 00:00      
                     code size decrease            01/01/70 00:00      
                        Maybe            01/01/70 00:00      
                  After a nights sleep            01/01/70 00:00      
         Where it gets specific to Keil (or whatever)            01/01/70 00:00      
   Explain            01/01/70 00:00      
      Woops.            01/01/70 00:00      
         such a 'newb' error (sic)            01/01/70 00:00      
   Password application            01/01/70 00:00      

Back to Subject List