如何手工把内容输出来????

cpp99 2003-10-17 04:30:49
#include <stdio.h>
#include <process.h>

FILE *stream;

void main( void )
{
int i = 10;
double fp = 1.5;
char s[] = "this is a string";
char c = '\n';

stream = fopen( "fprintf.out", "w" );
fprintf( stream, "%s%c", s, c );
fprintf( stream, "%d\n", i );
fprintf( stream, "%f\n", fp );
fclose( stream );
system( "type fprintf.out" );
}

上面的代码可以在屏幕上打出东东
运行下面的代码

#include <stdio.h>
//#include <process.h>

FILE *stream;

void main( void )
{
int i = 10;
double fp = 1.5;
char s[] = "this is a string";
char c = '\n';

stream = fopen( "fprintf.out", "w" );
fprintf( stream, "%s%c", s, c );
fprintf( stream, "%d\n", i );
fprintf( stream, "%f\n", fp );
fclose( stream );
//system( "type fprintf.out" );
}

然后
我在CMD中敲type fprintf.out
无效

请问:
在运行该程序后
如何手工把内容输出来????
...全文
86 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
hcj2002 2003-10-19
  • 打赏
  • 举报
回复
在Dos或命令行中用 〉程序名 >>aaa.TXT

69,336

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧