totn C Functions

C Language: memset function
(Initialize Memory Block)

In the C Programming Language, the memset function stores c into the first n characters of the object pointed to by s.

Syntax

The syntax for the memset function in the C Language is:

void *memset(void *s, int c, size_t n);

Parameters or Arguments

s
A pointer to a memory block that will be filled.
c
The value to be stored.
n
The number of characters to be stored.

Returns

The memset function returns s.

Required Header

In the C Language, the required header for the memset function is:

#include <string.h>

Applies To

In the C Language, the memset function can be used in the following versions:

  • ANSI/ISO 9899-1990

See Also

Other C functions that are noteworthy when dealing with the memset function: