![]() |
![]() |
![]() |
C++ Reference: memset()
memset()
Declaration
void* memset(void* vpDest, int iChar, size_t qCount);
Description
This function copies "qCount" chars with the value "iChar" to the buffer "vpDest." The function returns the pointer "vpDest."
Example
#include <cstdio>
#include <cstring>
int main()
{
char caDest[] = "XoaX.net";
printf("Before Memset: %s\n", caDest);
// Make the first chars 'T'
memset(caDest, 'T', 4);
printf("After Memset: %s\n", caDest);
return 0;
}
Output:
![]() |
![]() |
![]() |
| Home | | | Reference | | | Play Games! | | | Blog | | | Forum | | | Site Map | | | Contact Us |





