http://blog.csdn.net/codexy/article/details/5390550

 

直接上代码:

#include <stdio.h>
#include <windows.h>

int main(void)
{
    FILE *fp;
    char temp;
    char buf[100];
    if((fp=fopen("com5","r"))==NULL) puts("Can't open com3 /n");
    while(1)
    {
        temp=0;
        fscanf(fp,"%c",&temp);
        if(temp!=0)
            putchar(temp);
        else
            Sleep(100);
    }
    fclose(fp);
    return 0;
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2021-12-28
  • 2021-05-16
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案