javaguru007
Programmer
Given a value to a Memory Address/Location, can somebody teach me on how to clear the values in the memory ?? I was to place NULLS ('\0') values in the said locations. Thanks.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <memory.h>
void clearMem(
ATYPE* pType
, size_t nSize
) {
memset(pType, 0x00, nSize * sizeof(ATYPE));
return;
}
while (1) {
LPCWSTR lpcwSource = GetValue();
if (*lpcwSource != 0) {
ProcessData(lpcwSource);
*lpcwSource = 0;
}
}
static WCHAR achLastValue[1024 + 1] = "";
static WCHAR achValue[1024 + 1] = "";
LPCWSTR getNewValue() {
LPCWSTR lpcwDllValue = GetValue();
achValue[0] = 0;
if (_tcscmp(lpcwValue, achLastValue) != 0) {
_tcscpy(achLastValue, lpcwValue);
_tcscpy(achValue, lpcwValue);
}
return achValue;
}