| |||
| Home > RealView Debugger Predefined Macros > Alphabetical predefined macro reference > memclr | |||
Clears memory contents in a specified range.
char *memclr (str1, count) char *str1; int count;
where:
str1A character pointer to the memory location of the
first character byte in a string of characters that is replaced
by the NUL character.
countA
variable of integer type, used to specify the number of consecutive bytes
of memory in a character string that are to be replaced by the NUL character.
This macro replaces the specified number of characters in str1 with
the NUL character ‘\0’ starting
at the beginning of str1. If count is
less than the length of str1, the macro returns
a pointer that points to the address of the character following
the area that is cleared.
char *Points to the first character byte after the string
of characters overwritten with the NUL character.
This enables continuation of the writing process with perfect alignment
of bytes for file erasure.
This example shows how to use memclr:
define /R void memoryClr()
{
char buff[37];
char *posn;
strcpy(buff,"1234567890abcdefghijklmnopqrstuvwxyz");
posn = memclr(buff,20);
$printf "%s\n",posn$;
}
.