在vs2012编写c语言是出出现:操作类型不兼容(“char”和“const char”)的错误是什么原因?
#include<stdio.h>#include<stdlib.h>main(){charcc;FILE*fp;if((fp=fopen("C:\\lower.txt"...
#include <stdio.h>
#include <stdlib.h>
main()
{
char cc;
FILE *fp;
if((fp=fopen("C:\\lower.txt","wt+"))==NULL)
exit(0);
printf("请输入一个字符串 以“!”确认结束:");
rewind(stdin);
scanf("%c",&cc);
while(cc!="!")
{
if(cc>='A'&&cc<='Z')
cc+=32;
fputc(cc,fp);
scanf("%c",&cc);
}
fclose(fp);
} 展开
#include <stdlib.h>
main()
{
char cc;
FILE *fp;
if((fp=fopen("C:\\lower.txt","wt+"))==NULL)
exit(0);
printf("请输入一个字符串 以“!”确认结束:");
rewind(stdin);
scanf("%c",&cc);
while(cc!="!")
{
if(cc>='A'&&cc<='Z')
cc+=32;
fputc(cc,fp);
scanf("%c",&cc);
}
fclose(fp);
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询