Codeforces functionality may be limited from June 18, 19:00 (UTC) to June 19, 3:00 AM (UTC) due to technical maintenance. Polygon will work as usual. ×

b14ck_5m0k3's blog

By b14ck_5m0k3, history, 18 months ago, In English

char S[3], T[3]; cin >> S[0] >> S[1] >> S[2]; cin >> T[0] >> T[1] >> T[2]; why (S == T) gives no correct output, when it is?

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
18 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Because S and T refers to pointer to these arrays. If you compare them you will get the result of comparing two pointers, not arrays.