阵列我在做一个训练演习时遇到它起步的麻烦。我必须编写一个数组数据结构的程序。提供了一个测试工具,我需要实现数据结构的代码。我不知道如何在头文件中定义的数组C++中头文件
波纹管是测试工具的main.cpp,我不能在头文件编辑
#include <fstream>
#include <iostream>
using namespace std;
// *****************************
// you need to create this class
// *****************************
#include "ArrayIntStorage.h"
int main(int argc, char **argv) {
// ***********************************
// non-sort read & then sort using std
// ***********************************
ifstream fin1("ACW2_data.txt");
ofstream out1("1-arrayUnsortedRead.txt");
//ofstream out2("2-arrayUnsortedRead-thenSTDSort.txt");
if(!fin1.is_open())
{
cout << "FAIL" << endl;
return 1;
}
ArrayIntStorage arrayStorage1;
arrayStorage1.setReadSort(false); // do not read sort
// read in int values into data structure
fin1 >> arrayStorage1;
// output int values in data structure to file
out1 << arrayStorage1;
// sort data structure using std
arrayStorage1.sortStd();
// output int values in data structure to file
out2 << arrayStorage1;
fin1.close();
out1.close();
out2.close();
的任何信息,以及如何将它们与这个主要使用文件将不胜感激
的Merci beaucoup
这是不现实的练习。应该提供'ArrayIntStorage'类的头文件和文档。我会大声和粗暴地抱怨,对任何懒惰,傲慢的灵魂设定这个练习。 – 2011-04-30 13:21:57