www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/01/16:01:59

From: eglebbk AT phys DOT uva DOT nl (Evert Glebbeek)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Acquiring data from files
Date: Sat, 01 Jul 2000 19:56:04 GMT
Organization: Physics student, University of Amsterdam
Lines: 25
Distribution: world
Message-ID: <395e4965.13728815@news.wins.uva.nl>
References: <8jko0m$qrb$1 AT pegasus DOT tiscalinet DOT it>
NNTP-Posting-Host: stol-117-159.uva.studentennet.nl
X-Trace: info.wins.uva.nl 962481304 5171 145.98.117.159 (1 Jul 2000 19:55:04 GMT)
X-Complaints-To: usenet AT science DOT uva DOT nl
NNTP-Posting-Date: Sat, 1 Jul 2000 19:55:04 +0000 (UTC)
X-Newsreader: Forte Free Agent 1.11/32.235
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Newsgroup: comp.os.msdos.djgpp
 From: "godsofmetal" <godsofmetal AT tiscalinet DOT it>
 On Sat, 1 Jul 2000 14:26:42 +0200

>Does anybody know how to acquire data from a file and how to store them in
>arrays.
>For istance, suppose we got two columns of data in a file *.* :
>
>COL1        COL2
>
>Mike          24
>George     12
>Felipe        67
>Timo          36
>Mika          29
>
>Is it possible to put the content of each col. in a string and in an array?
>
Yes to both questions. Do something like
fscanf (file, "%s %d", array_of_string[n], &(array_of_int[n]))
This should be covered in ANY book on C programming.

regards,

Evert Glebbeek

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019