关于C++问题---IO流

不知?会出现Cannotcompilethefile'f:\test\222.h';nocompiletoolisassociatedwiththefileextensi... 不知?会出现
Cannot compile the file 'f:\test\222.h';no compile tool is associated with the file extension.

请高手指教

#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
void main()
{ fstream outfile;
outfile.open("f2.dat",ios::out);
if (! outfile)
{cout<<"f2.dat can't open.\n";
abort();
}
outfile<<"this is a program.\n";
outfile<<"this is a program.\n";
outfile.close();
}
展开
 我来答
L_o_o_n_i_e
2006-06-02 · TA获得超过4.2万个赞
知道大有可为答主
回答量:8507
采纳率:38%
帮助的人:5437万
展开全部
程序编译应当无语法错误。

编译时,你的源程序名字用错了。
打成 'f:\test\222.h' 了,是吧。
源程序的扩展名应当是 .cpp

"Cannot compile the file 'f:\test\222.h';no compile tool is associated with the file extension." [无法编译'f:\test\222.h',因为没有编译工具与此扩展名对应]
意法半导体(中国)投资有限公司
2023-06-12 广告
STM32F103是一款高性能的嵌入式芯片,由意法半导体(STMicroelectronics)公司生产。它是STM32系列芯片之一,具有紧凑、低功耗、高性能等特点,被广泛应用于嵌入式系统中。STM32F103的主要特点包括:1. 集成了A... 点击进入详情页
本回答由意法半导体(中国)投资有限公司提供
Kironor
2006-06-02
知道答主
回答量:21
采纳率:0%
帮助的人:0
展开全部
把文件名后缀改成.cpp,重新载入再编译试试。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式