| |||
| Home > RealView Debugger Predefined Macros > Alphabetical predefined macro reference > memset | |||
Fills a specified area of memory with a character.
char *memset (dest, byte_value, count)
char *dest;
char byte_value;
int count;
where:
destA character pointer to the memory location where
the memset macro is to write a string of repeating
characters.
byte_valueA
character variable used to specify the number of times that a character is
written consecutively, beginning at the *dest address.
countAn
integer variable used to specify the number of times a particular character
is to be written consecutively, beginning with the byte whose address
is *dest.
This macro writes a character in memory multiple times. The memset macro
writes the character byte_value into the contents
of the first count bytes in memory, beginning with the byte pointed
to by dest. For example, write character ‘X’ consecutively,
one hundred times, beginning at address 0x8f51fff4.
char *Points to the destination location that is one byte beyond the last byte written to. This enables continuation of the writing process with perfect alignment of bytes for string concatenation of memory blocks.
This example shows how to use memset:
define /R void memorySet()
{
char buff[37];
char *posn;
posn = memset(buff,'@',20);
$printf "%s\n",buff$;
}
.