All pastes #71008 Raw Edit

Untitled

public text v1 · immutable
#71008 ·published 2006-06-25 02:59 UTC
rendered paste body
/* 
 * 
 *	Project 2 
 * 
*/

#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>

using namespace std;


int main(int argc, char *argv[])
{
	string Words[1000];

	string FilesToLoad[1000];  // Array of files to load
	int FilesToLoadCount = 0;

	string FilesToExclude[1000];
	int FilesToExcludeCount = 0;

	string OutputFile;

	int DisplayOutputCount = 0;

	if(argc == 1)
	{
		cout << "Need More Arguments!" << endl;
		exit(2);
	}

	bool NoNext = false;

	for(int i = 0; i < argc; i++)
	{	
		string my_arg = argv[i];
		string my_arg_next;

		if( (i+1) < argc )
		{
			my_arg_next = argv[i + 1];	
		}
		else
		{
			my_arg_next = "";
			NoNext = true;
		}
		
		if( my_arg == "-x" )
		{
			if(NoNext)
			{
				cout << "Error No Exclude file specified" << endl;
				exit(1);
			}
			else
			{
				FilesToExclude[FilesToExcludeCount] = my_arg_next;
				FilesToExcludeCount++;
				i++;
			}
		}
		else if ( my_arg == "-o" )
		{
			if(NoNext)
			{
				cout << "Error No Output File, Using Default!";
				OutputFile = "output.txt";
				i++;
			}
			else
			{
				OutputFile = my_arg_next;
				i++;
			}
		}
		else
		{
			FilesToLoad[FilesToLoadCount] = my_arg;
			FilesToLoadCount++;		
		}
	}




	return 0;
}


void