topical media & game development
professional-program-11-GridEmpty-GridTestZeroInitialized.c
? /
professional-program-11-GridEmpty-GridTestZeroInitialized.c
include <GridZeroInitialized.h>
include <iostream>
using namespace std;
template <typename T>
void printGrid(const Grid<T>& g)
{
for (int i = 0; i < g.getWidth(); i++) {
for (int j = 0; j < g.getHeight(); j++) {
cout << g.getElementAt(i, j) << " ";
}
cout << endl;
}
cout << endl;
}
int main(int argc, char** argv)
{
Grid<int> myIntGrid;
Grid<int> myIntGrid2;
Grid<int> myIntGrid3(myIntGrid);
printGrid(myIntGrid);
printGrid(myIntGrid2);
myIntGrid = myIntGrid3;
myIntGrid.setElementAt(3, 4, 5);
cout << myIntGrid.getElementAt(3, 4) << endl;
// SpreadsheetCell emptyCell;
// Grid<SpreadsheetCell, emptyCell> mySpreadsheet; // WILL NOT COMPILE
return (0);
}
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.