PegType ** peg;
(where PegType is a typedef I define)
How would I initialize the array to create the grid I want? Right now I have the following, but it doesnt work:
1 2 3 4 5 6 7 8 9
peg = new PegType* [numRows];
// loop through and fill in the array with appropriate values
for (int i = 0; i < numCols; i++){
// Fill the pointer array positions with PegType arrays
peg[i] = new PegType[numRows];
}
NOTE: numRows and numCols hold correct values(I've checked).
Could you write what it is not working, what you expect your code to do, and what they do ?
Can't you use operator[] or whatever else write it so that we could help you.