Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    [C] fwrite && fread

    ho letto da tutte le parti (anche sul mio libro del C) ma non ho ancora capito che servono queste due funzioni: fwrite e fread oltre a leggere e a scrivere dati BINARI giusto? Mi fate degli esempi. Mi spiegate un pò?


    Grazie

  2. #2
    Utente di HTML.it
    Registrato dal
    Jul 2010
    Messaggi
    466
    codice:
    
    #include <stdio.h>
    size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
    
    size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
    
    The  function  fread()  reads  nmemb  elements of data, each size bytes
    long, from the stream pointed to by stream, storing them at  the  loca-
    tion given by ptr.
    
    The  function  fwrite()  writes nmemb elements of data, each size bytes
    long, to the stream pointed to by stream, obtaining them from the loca-
    tion given by ptr.
    FILE *stream può essere stdin, stdout, stderr ma anche un file di testo.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.