#include <iostream>
using namespace std;
void MemoryAlloc(char** ppcBuffer, size_t size)
{
*ppcBuffer= new char[size];
}
void MemoryFree(char **ppcBuffer)
{
if (ppcBuffer!= NULL)
{
if (*ppcBuffer!= NULL)
{
delete [] *ppcBuffer;
}
}
}
int main(void)
{
char* pBuffer = NULL;
MemoryAlloc(&pBuffer, 100);
if (pBuffer == NULL)
{
cout << " NULL" << endl;
}
else
{
cout << "Alloc Success" << endl;
}
MemoryFree(&pBuffer);
return 0;
}