sequential file writing

The Friend amigo at milton.u.washington.edu
Tue Dec 4 10:19:34 AEST 1990


     I need some examples on how to read/write to a sequential file containing
10 names & ages. My init would be to:
          char *names[10]={............};
          int ages[10]={.............};

     from there I need info on specific use of file writing. I can
use:
      fprintf(*fp,"%s%c%d", names,DELIM,ages);

     where *fp is the file pointer, names the name pointer, a deliminator
     to seperate file information (in this case a '|'), and ages init array.

     Reading I guess would be as easy as fscanf, but I'm unsure on format.

     Basically all I need is everything from file writing to reading using
     *names, and ages.

     
     Thanks..email these  back please.



More information about the Comp.lang.c mailing list