Code as below:
#include <iostream>
#include <cstdio>
using namespace std;
typedef char BYTE;
#define BUF_SIZE 30
class A
{
public:
A();
~A(){}
inline const BYTE* GetBuffer() const { return m_pBuf; }
int Pop(void);
private:
const BYTE* m_pBuf;
};
A::A():m_pBuf() //<---line 19
{
BYTE* pBuf = new BYTE[BUF_SIZE];
if (pBuf == NULL)
return;
for (int i=0; i<BUF_SIZE; i++)
{
pBuf[i] = i;
}
m_pBuf = pBuf;
}
int main()
{
A a;
const BYTE* pB = a.GetBuffer();
if (NULL != pB)
{
for (int i = 0; i<BUF_SIZE;i++)
printf("%u", pB[i++]);
}
return 0;
}
I am trying to figure out how many kind of initialization list of the C++ constructor provided. And I find a special one above.Can someone please help to explain line 19. don't know what does that mean. thx in advance.