Line | |
---|
1 | #include "auxiliar.h"
|
---|
2 |
|
---|
3 | using namespace Geometry;
|
---|
4 |
|
---|
5 | // FUNCIONES DE ALLOCATE
|
---|
6 |
|
---|
7 | uint32 **Allocate2DArrayINT(uint32 nRows, uint32 nCols){
|
---|
8 | //uint32 **Allocate2DArrayINT(uint32 nRows, uint32 nCols){
|
---|
9 | uint32 **ppi,*pool,*curPtr;
|
---|
10 | //unsigned short int **ppi,*pool,*curPtr;
|
---|
11 | //(step 1) allocate memory for array of elements of column
|
---|
12 | ppi = new uint32*[nRows];
|
---|
13 | //(step 2) allocate memory for array of elements of each row
|
---|
14 | pool = new uint32 [nRows * nCols];
|
---|
15 | // Now point the pointers in the right place
|
---|
16 | curPtr = pool;
|
---|
17 | for( int i = 0; i < nRows; i++) {
|
---|
18 | *(ppi + i) = curPtr;
|
---|
19 | curPtr += nCols;
|
---|
20 | }
|
---|
21 | return ppi;
|
---|
22 | }
|
---|
23 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.