Test strings to see if they match?

Okay, I have been trying for hours to get this to work, and I made it quite a ways on my own, but this last little bit has me stumped.
Basically, I need to test two strings to see if they match, and use that in an "if" statement.

What I've got now is:

if (InputValueC == Input10)

I've also tried these two:

if ('InputValueC' == 'Input10')
if ((InputValueC) == (Input10))

Monitoring the Software Serial "print" command, I can see that both of these strings are the same. But, it does not execute the code following the "if" statement.
The syntax for the "if" statement I'm using (as far as I can tell) is correct:

if (test)
{
run 
these 
commands
}
else
{
run 
these
other
commands
}

You need to use the strcmp() function, if both stings are equal then strcmp(string1, string2) == 0.
You can also use strcasecmp() to compare them without regard to case.

strcmp("ok", "ok") == 0
strcmp("OK", "ok") != 0
strcasecmp("OK", "ok") == 0

Check out string.h

http://www.nongnu.org/avr-libc/user-manual/group__avr__string.html

Thanks for the response.

Now, it works for most of it, but not part of it. I'm not sure why, though, but I do have a theory.

Is is possible to change a string within the loop, but after it was already declared (before the loop)? If so, then I'm doing something wrong. I'm using "char" both places. Before the loop starts, I have this code:

char LightState[3] = 
{
  Input0, InputL
};
char LightState0[3] = 
{
  Input0, InputL
};
char LightState1[3] = 
{
  Input1, InputL
};

Then, from within the loop, I try to change it with:

                char LightState[3] = 
                {
                  Input1, InputL
                };

After that, I have the test:

{
  {  mySerial.print("Test");
    if (strcmp(LightState, LightState1) == 0)
    {
      mySerial.print("LightsWillShow");
      goto LightShow;
    }
    else
    {
      mySerial.print("LightsWillNotShow");
      goto LightNoShow;
    }
  }

Printing to the serial was my debugging technique, to see where the problem was. Considering that it prints "LightsWillNotShow" on the serial line, I figured it had something to do with the "char" statements.

Is it possibly because of the extra whitespace? I've always read that this didn't matter, but I am not the one to answer this question; I have extremely little programming knowledge.

@peter247:
I just now saw your response. I looked at that page, and I do not understand it. Also, when I first tried putting this code at the top of the sketch:

#include <string.h>

It gave some error about not being able to find it/it not existing. However, after trying it again just now, it compiles without errors.

(Yet, I still do not understand the code on the page you linked to. Major newbie here. ;))

Is is possible to change a string within the loop, but after it was already declared (before the loop)?

Yes. Strings in C are just character array variables. Try this:

char buf[32];  // character array buffer

void setup ()
{
  Serial.begin (9600);
  strcpy (buf, "hello");  // initial string
}

void loop ()
{
  Serial.println (buf);
  strcpy (buf, "goodbye");
  delay (1000);
}

In that code, the initial value of 'buf' is copied in with 'strcpy', then overwritten. You can also access individual characters like this:

  buf[2] = 'Z';

Or even:

  if (buf[0] == 'h') {
    // do something here
  }

@Anachrocomputer:
Okay, so, in my example, I would leave the "char" in place at the beginning of the sketch, and from within the loop, I would use:

strcpy(LightState, LightState1);

Is this correct? (Would this replace the contents of the string "LightState" with the contents of the string "LightState1"?)

Would this replace the contents of the string "LightState" with the contents of the string "LightState1"

Yes, assuming you had already declared those strings and given them reasonable ASCII contents. But be careful, because 'strcpy' does not check the length of the strings in any way. If the new contents (LightState1) are longer (more characters) than the space you've allocated in the destination string (LightState), then you will overwrite memory somewhere. Most likely somewhere bad!

Remember to allow room in the strings for the terminating zero byte:

char buf[5]; // Five characters, indexed 0..4

buf[0] = 'A';
buf[1] = 'B';
buf[2] = 'C';
buf[3] = 'D';
buf[4] = '\0'; // string terminator

strcpy (buf, "WXYZ");  // Fills 'buf'

You don't see the '\0' in that last line (the compiler puts it in for you), but it still takes up space in the array.

Okay, thanks... I'll try that here sometime soon...

Whoops! I thought I had already reported back. Sorry about that.

Yes, it did work. Thank you!