I'm having trouble with the if statement. I have verified with print statements that (int)strings_line_tokens[l][m] == 0. I thought maybe my logic was backwards since I had two not statements with an or, so I changed it to an and. That didn't help either.

if((int)strings_line_tokens[l][m] != 10 || (int)strings_line_tokens[l][m] != 0)
{
    error_on_flag[strings_special_token_incrementer] = 1;
    //printf ("setting  error_on_flag[strings_special_token_incrementer] = 1 \n");
}



strings_line_tokens[l][m] is 0
setting  error_on_flag[strings_special_token_incrementer] = 1

if((int)strings_line_tokens[l][m] != 10 || (int)strings_line_tokens[l][m] != 0)

This says: if (true) There is no number in the universe for which this statement doesn't come out true.

The first part comes out as true for everything that isn't 10. For the one case where the value you're testing is 10, the second part comes out as true.

What are you actually trying to do? Under what circumstances do you want the contents of the if block to run?

I like it when you ask it that way :).

When I have a 10 or 0. I figured I mixed up the logic and changed the or to an and but that didn't fix the problem.

When I have a 10 or 0.

if((int)strings_line_tokens[l][m] == 10 || (int)strings_line_tokens[l][m] == 0)

This if block will execute when (int)strings_line_tokens[l][m] is 10.
This if block will execute when (int)strings_line_tokens[l][m] is 0.

For all other values of (int)strings_line_tokens[l][m], the if block will not execute.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.