Strcmp not working? Can't figure out what im doing wrong...

So I am using the parralax RFID sensor, specifically the tutorial here:

http://www.arduino.cc/playground/Learning/PRFID

Pretty easy to get that working, but now i want to compare if a specific tag was 'swiped'. Now I admit my C is SUPER rusty, but um, cannot figure out why this isn't working: (could be its a sign I should goto bed :) )

 if(strcmp(code, storedTag) == 0)
     {
        //never gets here?
     }

whre code =

char code[10]

and is filled out via RFID reader, like in tutorial above. and then

char storedTag[10]

is:

  storedTag[0] ='3';
  storedTag[1] ='6';
  storedTag[2] ='0';
  storedTag[3] ='0';
  storedTag[4] ='7';
  storedTag[5] ='8';
  storedTag[6] ='A';
  storedTag[7] ='A';
  storedTag[8] ='4';
  storedTag[9] ='C';

The cards tag number I am using. So what am I missing? I print both the code and storedTag out they are equal...?

You're missing a string null terminator.

You're missing a string null terminator.

At least in the storedTag array.

You are also missing (posting) any code that shows how code is valued. It, too, may be missing a terminating NULL.

okay, fair enough...does that make the storedTag array 11 bytes long then? instead of 10?

I guess I didn't know where to throw that terminator at. (The code for the RFID tag must be doing this automatically for me)

does that make the storedTag array 11 bytes long then? instead of 10?

Yes, and yes.

I guess I didn't know where to throw that terminator at.

storedTag[10] = '\0';

The code for the RFID tag must be doing this automatically for me

Why do you assume that?

I assumed it cause after running code a few more times and printing both strings out, the code tag string would print just fine, the storedTag would print and every so often garbage would be printed out afterwards...

would it be wiser to use a

strcpy(storedTag, "360078AA4C"); ?

thanks guys,its been ages since i've dealt with strings in this manner. C# and Java hath ruined me.

would it be wiser to use a

strcpy(storedTag, "360078AA4C"); ?

After you stored 360078AA46 in storedTag, that would be guaranteed to be true, wouldn't it.

C# and Java hath ruined me.

Being fluent in C# and/or Java does not prevent you from posting your code so we can check your other assumptions.