Compare equality of char[] in C

后端 未结 5 2181
抹茶落季
抹茶落季 2020-12-06 17:52

I have two variables:

char charTime[] = \"TIME\";
char buf[] = \"SOMETHINGELSE\";

I want to check if these two are equal... using ch

5条回答
  •  时光说笑
    2020-12-06 18:06

    You are checking the identity charTime and buf. To check the equality, loop over each character in one array and compare them with the related character in the other array.

提交回复
热议问题