forked from Thomas-Mielke-Software/EasyCash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2DArray.cpp
More file actions
35 lines (30 loc) · 724 Bytes
/
2DArray.cpp
File metadata and controls
35 lines (30 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// 2DArray.cpp: implementation of the C2DArray class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Msp.h"
#include "2DArray.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
C2DArray::C2DArray():
m_rows(0), m_cols(0), m_pData(0)
{
}
void C2DArray::Init(int rows, int cols)
{
m_rows=rows;
m_cols=cols;
m_pData = new W_PTR[m_rows * m_cols];
memset(m_pData, 0, m_rows * m_cols);
}
C2DArray::~C2DArray()
{
if(m_pData)
delete[] m_pData;
}