c语言if条件a等于 一个字符串怎么写

如题所述

包含头文件string.h

#include <string.h>
然后用strcmp进行比较,假设与字符串"hello"进行比较
......
if(strcmp(a,"hello")==0)
printf("相等\n");

else
printf("不相等\n");
......
温馨提示:答案为网友推荐,仅供参考
相似回答