나는 훈련 연습을하고 있으며 시작하는 데 문제가 있습니다. 배열 데이터 구조에 대한 프로그램을 작성해야합니다. 테스트 하네스가 제공되며 데이터 구조에 대한 코드를 구현해야합니다. 나는 헤더 파일에 배열을 정의하는 방법을 잘 모르겠습니다헤더 파일의 C++ 배열
우는 소리입니다 내가 헤더 파일에
#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();
정보를 편집 할 수있는 방법이 주요 함께 사용하기 위해 테스트 환경을 MAIN.CPP 파일은 많은 아래와 같이해야
이것은 비현실적인 운동입니다. 'ArrayIntStorage' 클래스의 헤더 파일과 문서가 제공되어야합니다. 저는이 게으른 오만한 영혼이이 운동을 시작한 곳으로 큰소리로 그리고 격렬하게 불평 할 것입니다. –