Warning comparison between pointer and integer

后端 未结 3 2030
无人共我
无人共我 2021-02-04 01:57

I am getting a warning when I iterate through the character pointer and check when the pointer reaches the null terminator.

 const char* message = \"hi\";

 //I         


        
3条回答
  •  北海茫月
    2021-02-04 02:25

    This: "\0" is a string, not a character. A character uses single quotes, like '\0'.

提交回复
热议问题