Edit: This is a duplicate and I've flagged it as such. See [question] Why is "a" != "a" in C?
So I'm trying to print out a specific message depending on a field within a struct. The field contains the string "1".
Whenever I run printf("%s", record.fields[2]);
the output is 1
; I've no format warnings.
However, when I check the field against the corresponding string (in this case, "1"), it fails the check:
if (record.fields[2] == "1") {
printf("The field is 1!");
}