forked from QtExcel/QXlsx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update example : copycat, helloandroid, webserver
- Loading branch information
Showing
8 changed files
with
178 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// DynArray2D.h | ||
#ifndef DYNARRAY2D_H | ||
#define DYNARRAY2D_H | ||
|
||
// Code from https://www.qtcentre.org/threads/31440-two-dimensional-array-size-determined-dynamically | ||
// Some code is fixed by j2doll | ||
|
||
template <typename T> class DynArray2D | ||
{ | ||
public: | ||
DynArray2D(int n, int m) | ||
{ | ||
_n = n; | ||
_array = new T*[n]; | ||
for(int i = 0; i < n; i++) | ||
{ | ||
_array[i] = new T[m]; | ||
} | ||
} | ||
|
||
void setValue(int n, int m, T v) | ||
{ | ||
_array[n][m] = v; | ||
} | ||
|
||
T getValue(int n, int m) | ||
{ | ||
return _array[n][m]; | ||
} | ||
|
||
~DynArray2D() | ||
{ | ||
for (int i = 0 ; i < _n ; i++) | ||
{ | ||
delete [] _array[i]; | ||
} | ||
delete [] _array; | ||
} | ||
|
||
protected: | ||
T **_array; | ||
int _n; | ||
}; | ||
|
||
|
||
#endif // DYNARRAY2D_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters