Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!dali.cs.montana.edu!milton!amigo From: amigo@milton.u.washington.edu (The Friend) Newsgroups: comp.lang.c Subject: read/write to file Keywords: read write file Message-ID: <12167@milton.u.washington.edu> Date: 3 Dec 90 04:48:46 GMT Organization: University of Washington, Seattle Lines: 28 s I'm looking for examples on how to create files - putting sequential data in them, this includes a string and a integer. Specifically its a name and age list. What I've brewed up so far hasn't been the greatest of success, so I'm looking for better ways to go about it. First round for me using files, so this explains my problem.. So I have 10 names & ages down in two arrays: static char names[10][]={........}; static int ages[10][]={.........}; Given I define pointes and the like: FILE *fp fp=fopen("test_file","w+"); /* w+ so it reads later on, using rewind() or some such */ Next I have a loop set up to dump the array to the file, but thats where it gets complicated: fprintf(fp,"%s%d", names[10][], ages[10][]); Brought to you by Super Global Mega Corp .com