comparing character

Hi
I have a problem to with comparing two characters.

When I compare a char which is read from gps, with my char A, the solution of this compair is evertime false.
If the char red from gps is really A, the compare is still false…
How can I find out if there is a A in ((char*)GPS.arguments[2])?

if (((char*)GPS.arguments[2]) == "A")

"A" is a string. 'A' is a character.

The corrected code throws an error: ISO C++ forbids comparison between pointer and integer

if (((char*)GPS.arguments[2]) == 'A')

How must I write it?

"char*" is a pointer, so

if (GPS.arguments[2] == 'A')

should do the trick.

Error message is still the same....

Well, if you actually told us what a "GPS" looked like, we could dispense with the banter.

Perhaps I found a possibility with this code:

char* A = {"A"};
  if ((char*)GPS.arguments[2] == (char*)A[0])

But I have to go outdoor and wait until gps is set up (A is only printed if data is valid). It’s cold outdoor, but I have to try it :slight_smile:

Well, if you actually told us what a "GPS" looked like, we could dispense with the banter, and you don't have to suffer any discomfort.

It's a libelium gps module ...brrrr

Not the module, the variable. >:(

Sorry, I don't know what you are asking (my english isn't good enough).

The variable who the gps is writing in the array can be a A or a V. When the pointer shows on position 2 in the array like: GPS.arguments[2], it should return the character A or V....

So I thought that I can compare this character with another char.

Show us the C declaration of the "GPS" variable (as in "GPS.arguments[2]") from your sketch, my psychic powers are failing. Please.