有没有哪位编程高手可以把我的c++转换成c语言的?求助高手!!!!!!!!!

[复制链接]
查看11 | 回复1 | 2013-1-25 05:09:34 | 显示全部楼层 |阅读模式
#include stdio.h#include stdlib.hint main(){
FILE f;
int i;
int count=0;
int wights[128]={0};
char ah;
char *temp;
int keynum=0;
int n=0;
char bh;
f=fopen(input.txt,r+);
if(!f)
{
printf(cannot open the file);
exit(0);
}
printf(你的原始文件为:);
while((ah=fgetc(f))!=EOF)
{
wights[ah]++;
printf(%c,ah);
}
fclose(f);
f = fopen(input.txt,r+);
temp=(char*)malloc(count+1);
while(!eof(f))
{
bh = fget(f);
temp[n++]=bh;
}
printf(n);
printf(n);
fclose(f);
printf(输入你的关键字个数:);
fscanf(%d,
for(int k=0;kkeynum;k++)
{
char pointer;
printf(n);
printf(请输入你要查询的关键字: );
scanf(%c,
printf(n);
for(i=0;i128;i++)
{
if((int)pointer==i)
{
printf(%c共出现了:%d 次。,pointer,wights);
}
}
printf(n);
printf(位置如下所示:);
for(i=0;icount;i++)
{
if(pointer==temp)
{
printf(%d,temp);
}
else
printf(*);
}
printf(n);
}
printf(n);printf(n);printf(n);
return 0; }只是我临时改的有问题你再调一调追问这个怎么调试回答FILE f; 改为FILE *f; 赞同0|评论
回复

使用道具 举报

千问 | 2013-1-25 05:09:34 | 显示全部楼层
这个c++程序就有问题赞同0|评论
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行