Comparing one array

Hello, I'm using an array to store the received string by the serial port. I dont know why a compare do not works. See:

if (rxBuffer[3] == '-') value = value * -1;

I just wanna check if on the rxBuffer[3] has a minus symbol to convert my int into negative if I receive a '-';

Can anyone help me???

Is rxBuffer a 2 or 1 dimensional array? How do you declare it?

If its data coming in externally, what assurances do you have that its always going to be the fourth character that contains '-'?

Thanks pYro_65 to help me, thsi is the way that the array is declared:

char rxBuffer[10];

Well, it seems obvious that the character ‘-’ is not actually where you expect it to be!
Do you know that arrays start at index 0, not 1, so rxBuffer[3] is looking at the fourth character.

Have you tried writing a loop and printing out the contents so you can visualize the actual data you are trying to parse.

Instead of asking us to diagnose your program from one line, why don't you show us enough of it to figure it out? Post the whole thing. And describe where the serial data is coming from and what it should contain.

Hi pYro_65, I did all tests before post my question... Yes the '-' is on the right place... :(

LeoTakahatata: Hi pYro_65, I did all tests before post my question... Yes the '-' is on the right place... :(

I'll just assume it isn't. Prove me wrong with an example sketch.