include <iostream.h>
#include <fstream.h>
#include <vector>using namespace std; // 打开std名字空间。 ofstream 声明在std里void main()
{
ofstream outfile("xx.txt",ios_base::app );
}
#include <fstream.h>
#include <vector>using namespace std; // 打开std名字空间。 ofstream 声明在std里void main()
{
ofstream outfile("xx.txt",ios_base::app );
}
#include <fstream.h>
#include <vector>//using namespace std; // 打开std名字空间。 ofstream 声明在std里void main()
{
ofstream outfile("d:\\xx.txt",ios::out );
outfile<<"china\n";
cout<<"finish\n";
}
//这是可以运行的程序!~~~~~~不知道那为仁兄需要什么样的效果
//名字空间在里我没有见过怎么用~~~`也不知道怎么用(也不知道VC支持不支持名字空间)~~~~不过在java ,c#中都有名字空间的概念,不过我还没有接触过她如何使用~~~~~
#include <iostream>
#include <fstream>
#include <vector>using namespace std; // 打开std名字空间。 ofstream 声明在std里void main()
{
ofstream outfile("d:\\xx.txt",ios::out );
outfile<<"china\n";
cout<<"finish\n";
}
Compiling...
VC_TEST_ARRAY_1.cpp
C:\TEST\VC_TEST_ARRAY_1.cpp(18) : error C2872: 'ofstream' : ambiguous symbol
Error executing cl.exe.VC_TEST_ARRAY_1.exe - 1 error(s), 0 warning(s)