Problem compare char with data array

if(data[1] == 1)

1 is not the same as '1'