-
Notifications
You must be signed in to change notification settings - Fork 0
/
C2A8E1_main-Driver.cpp
33 lines (26 loc) · 1.32 KB
/
C2A8E1_main-Driver.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#define INSTRUCTOR_FILE /* DO NOT DEFINE THIS MACRO IN ANY FILES YOU CREATE */
/******************** DO NOT MODIFY THIS FILE IN ANY WAY ********************/
/******************** DO NOT MODIFY THIS FILE IN ANY WAY ********************/
/******************** DO NOT MODIFY THIS FILE IN ANY WAY ********************/
/****************************************************************************
* Everything in this file was written to help test/verify your code and must
* not be altered in any way. Do not rename this file or copy anything from
* it into your file(s). This file does not necessarily represent good coding
* technique, proper formatting/style, or meet the requirements your code must
* meet. You do not need to understand the code in this file to write yours.
***************************************************************************/
#ifdef INSTRUCTOR_FILE
#include <cstdlib>
#include <fstream>
using std::ifstream;
ifstream *OpenFiles(char * const fileNames[], size_t count);
void MergeAndDisplay(ifstream files[], size_t count);
int main(int argc, char *argv[])
{
const int FILE_NAME1_ARG_NO = 1; // command line arg: first file name
ifstream *files = OpenFiles(&argv[FILE_NAME1_ARG_NO], size_t(argc - 1));
MergeAndDisplay(files, size_t(argc - 1));
delete[] files;
return EXIT_SUCCESS;
}
#endif