Ecriture binaire dans un flux (fwrite)

Syntaxe fwrite

#include <stdio.h>

/* Suite du code ... */

size_t fwrite(void *ptr, size_t taille, size_t n, FILE *stream);

/* Suite du code ... */

Remarque fwrite

Ecriture dans le flux stream de n objets ayant chacun une longueur de taille octets et placés dans une zone pointée par ptr.

size_t correspond à un unsigned int.

Il est possible d'utiliser sizeof à la place de size_t.

Valeur retournée par fwrite

Elle retourne le nombre d'objets (et non le nombre d'octets) réellement écrits. Le nombre total d'octets écrits est : n * taille

Contents Haut

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 19/03/2002, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/c-fwrite.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.