All pastes #2050196 Raw Edit

Untitled

public text v1 · immutable
#2050196 ·published 2011-04-24 20:28 UTC
rendered paste body
header file decs

class ArrayIntStorage
{
public:
	ArrayIntStorage(void);
	~ArrayIntStorage(void);
	void setReadSort(bool sort);
	bool returnReadIn() { return _sortRead; };
	void sortStd();
	void sortOwn();
	void AddData(int pos, int value);
	int getData(int pos);
private:
	bool _sortRead;
	int _data[10000];
	
};

// reads in

if(!i.returnReadIn())
{
	while (in.good())
	{
		getline (in, line);
		int Item = atoi(line.c_str());
		if(Item > 0)
		{
			i.AddData(counter, Item);
			counter++;
		}
	}
}

void ArrayIntStorage::AddData(int pos, int value)
{
	_data[pos] = value;
}