warning c4700大神们如何修改
虽然没有错误但是运行不了#include<stdio.h>
void main()
{
char *str1,*str2;
char *p,*q;
printf("请输入字符串1:\n");
gets(str1);
printf("请输入字符串2:\n");
gets(str2);
p=str1;
q=str2;
if(*p!=*q)
printf("两个字符串相等");
else
{
while ((*p==*q)&&(*p!='\0')&&(*q!='\0'))
{
p++;
q++;
}
if((*p=='\0')&&(*q=='\0'))
printf("两个字符串相等");
else
printf("两个字符串不相等");
}
}
D:\新建文件夹\Microsoft Visual Studio\MyProjects\字符比较\字符.cpp(7) : warning C4700: local variable 'str1' used without having been initialized
D:\新建文件夹\Microsoft Visual Studio\MyProjects\字符比较\字符.cpp(9) : warning C4700: local variable 'str2' used without having been initialized