Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!uflorida!haven!decuac!shlump.nac.dec.com!engage!ynotme.enet.dec.com!wallace From: wallace@ynotme.enet.dec.com (Ray Wallace) Newsgroups: comp.lang.c Subject: Re: read/write to file Message-ID: <1990Dec3.235135.6851@engage.enet.dec.com> Date: 3 Dec 90 23:48:24 GMT Sender: news@engage.enet.dec.com (USENET News System) Organization: Digital Equipment Corporation Lines: 20 In article <12167@milton.u.washington.edu>, amigo@milton.u.washington.edu (The Friend) writes... > I'm looking for examples on how to create files - putting sequential data > So I have 10 names & ages down in two arrays: > static int ages[10][]={.........}; This should be a single dimension array. static int ages[10]={.........}; > fprintf(fp,"%s%d", names[10][], ages[10][]); Try - for( next = 0; next < 10; ++next ) fprintf( fp, "%s%d\n", names[next], ages[next] ); --- Ray Wallace (INTERNET,UUCP) wallace@oldtmr.enet.dec.com (UUCP) ...!decwrl!oldtmr.enet!wallace (INTERNET) wallace%oldtmr.enet@decwrl.dec.com --- Brought to you by Super Global Mega Corp .com