Espaces de noms
Variantes
Actions

std::memset

De cppreference.com
< cpp‎ | string‎ | byte

 
 
Bibliothèque de chaînes de caractères
Chaînes à zéro terminal
Original:
Null-terminated strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Les chaînes d'octets
Chaines multi-octets
Les chaînes étendues
Classes
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string
char_traits
 
Chaînes d'octets à zéro terminal
Fonctions
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Manipulation caractère
Original:
Character manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Conversion aux formats numériques
Original:
Conversions to numeric formats
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
La manipulation de chaînes
Original:
String manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
strcpy
strncpy
strcat
strncat
strxfrm
Examen chaîne
Original:
String examination
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Manipulation de la mémoire
Original:
Memory manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
memchr
memcmp
memset
memcpy
memmove
Divers
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
strerror
 
Déclaré dans l'en-tête <cstring>
void* memset(void* dest, int ch, std::size_t count );
Convertit la valeur de chunsignedchar et le copie dans chacun des personnages count première de l'objet pointé par dest. Si l'objet n'est pas trivialement-copiable (par exemple, un scalaire, un tableau ou une structure C-compatible), le comportement est indéfini. Si count est supérieure à la taille de l'objet pointé par dest, le comportement n'est pas défini .
Original:
Converts the value ch to unsignedchar and copies it into each of the first count characters of the object pointed to by dest. If the object is not trivially-copyable (e.g., scalar, array, or a C-compatible struct), the behavior is undefined. If count is greater than the size of the object pointed to by dest, the behavior is undefined.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Sommaire

[modifier]Paramètres

dest -
pointeur vers l'objet à remplir
Original:
pointer to the object to fill
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ch -
remplir octet
Original:
fill byte
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
count -
nombre d'octets à remplir
Original:
number of bytes to fill
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier]Retourne la valeur

dest

[modifier]Exemple

#include <iostream>#include <cstring>   int main(){int a[20]; std::memset(a, 0, sizeof(a));std::cout<<"a[0] = "<< a[0]<<'\n';}

Résultat :

a[0] = 0

[modifier]Voir aussi

une copie du tampon à l'autre
Original:
copies one buffer to another
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction)[edit]
assigne une valeur à un nombre d'éléments
Original:
assigns a value to a number of elements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction générique)[edit]
checks if a type is trivially copyable
(classe générique)[edit]
C documentation for memset
close