当前位置: 代码迷 >> 综合 >> C语言读取文本字符串!
  详细解决方案

C语言读取文本字符串!

热度:26   发布时间:2024-01-15 03:21:08.0

位图还不会读取,先从读取文本的字符串开始吧。今晚尝试学会位图的读取

这是自己写的程序 ,还有许多不成熟的地方

*********************************************************************

#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>


int main(int argc, char* argv[])
{
FILE *fp;
char ch;
if((fp=fopen("F:\\come on.txt","r+"))==NULL)
{
printf("cannot open this file\n");
exit(0);
}
ch=fgetc(fp);
while(ch!=EOF)
{
putchar(ch);
ch=fgetc(fp);
}
fclose(fp);
}


  相关解决方案