Sorry in advance for the ignorance. I don\'t fully understand how to compare char arrays in C. I was originally comparing two char arrays in c with the simple ==
Doing this if (a == b)
will compare Pointer values stored in a
and b
.
So if you have a
a //say at some random address 1000
or b
b //say at some random address 2000
Is a==b
? Now normally if the compiler is doing string pooling and if your string literals are exactly same then this may work in those cases - otherwise you have to do a character-by-character comparison as strcmp
would i guess.