◐ Shell
clean mode source ↗

std::fwrite - cppreference.com

De cppreference.com

<metanoindex/>

<tbody> </tbody>

Definido no cabeçalho

<cstdio>

int fwrite( const void* buffer, std::size_t size, std::size_t count, std::FILE* stream );

Writes up to count objects from the given array buffer to the output stream stream as if by reinterepreting each object as an array of unsigned char and calling std::fputc size times for each object to write those unsigned chars into stream, in order. The file position indicator for the stream is advanced by the number of characters written.

Se os objetos não são TriviallyCopyable, o comportamento é indefinido.

Original:

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Se ocorrer um erro, o valor resultante do indicador de posição de arquivo do fluxo é

Original:

If an error occurs, the resulting value of the file position indicator for the stream is

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

indeterminate.

Parâmetros

buffer -

ponteiro para o objeto primeiro objeto na matriz a ser escrito

Original:

pointer to the first object object in the array to be written

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

size -

tamanho de cada objeto

Original:

size of each object

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

count -

o número de objetos a serem escritos

Original:

the number of the objects to be written

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Valor de retorno

Number of objects written successfully, which may be less than count if an error occurred.

Se size ou count é zero, fwrite retorna zero e não executa nenhuma outra ação.

Original:

If size or count is zero, fwrite returns zero and performs no other action.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Exemplo

Veja também

impressões saída formatada para stdout, um fluxo de arquivo ou um tampão

Original:

prints formatted output to stdout, a file stream or a buffer

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função) [edit]

escreve uma seqüência de caracteres para um fluxo de arquivo

Original:

writes a character string to a file stream

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função) [edit]

lê um arquivo

Original:

reads from a file

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função) [edit]

Documentação C para fwrite