Serial Programming question

    if(sync==0xaa)
a
A
a
B
a
C
a
D
a
A

Are you aware that 'a' is not the same as 0xAA?