All pastes #956764 Raw Edit

Mine

public text v1 · immutable
#956764 ·published 2008-03-25 15:31 UTC
rendered paste body
// \m/etal array
#include <iostream>

using namespace std;

class Foo
{
private:
	int value;
public:
	Foo(int);
	int GetValue();
};

Foo::Foo(int value)
{
	this->value = value;
}

int Foo::GetValue()
{
	return this->value;
}

int main (int argc, char** argv)
{
	Foo** foos = new Foo* [10];
	foos[0] = new Foo(0);
	foos[1] = new Foo(1);
	foos[2] = new Foo(2);
	foos[3] = new Foo(3);
	
	for(Foo** foo = foos; *foo != NULL; foo++)
	{
		cout << (*foo)->GetValue() << endl;
	}
	
	cin.get();
	
	return 0;
}