You need to use strncmp to compare strings:
if (strncmp(record.fields[2], "1", 1) == 0) ...
You need to compare to zero, because strcmp
returns zero when two strings are identical.
However, it looks like you are not comparing strings: rather, you are looking for a specific character inside the string. In this case, you need to use a character constant instead of a string literal (with single quotes):
if (record.fields[2] == '1') ...