Article View: alt.comp.lang.learn.c-c++
Article #310newbie in turbo c++ 3.0
From: EL
Date: Sat, 19 Jan 2002 16:11
Date: Sat, 19 Jan 2002 16:11
25 lines
1628 bytes
1628 bytes
i'm using turbo c++ 3.0 for writing a very simple program, criteria as
below:
open a text file which formated as
first 7 char is ID Number, Next 20 char is Name, Next 3 is marks 1, Next 3
is marks 2.
e.g 1002030ANDYLEUNG 100 95
Now I want to open and read the file by using ifstream & ofstream, then read
the line
which specify the length and put it into a defined structure like
struct
{
char *id, *name
int mark1, mark2
}studrec
however, i didn't know how to read the line with specific length of char and
how to loop it until end of file.
Anyone can help me to solve it.
Rgds.,
Newbie
Technical Details
Message-ID:
<a2c5ds$9nj1@imsp212.netvigator.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsgate.cuhk.edu.hk!newsgate.netvigator.com!imsp212.netvigator.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8d38,28dabf9af7da2c85,start X-Google-Attributes: gidf8d38,public X-Google-Thread: 109fba,28dabf9af7da2c85,start X-Google-Attributes: gid109fba,public X-Google-Thread: 114592,28dabf9af7da2c85,start X-Google-Attributes: gid114592,public X-Google-ArrivalTime: 2002-01-19 08:06:03 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsgate.cuhk.edu.hk!newsgate.netvigator.com!imsp212.netvigator.com!not-for-mail From: "EL" <lameddie@yahoo.com> Newsgroups: alt.comp.lang.learn.c-c++,borland.public.cpp.language,comp.lang.c++ Subject: newbie in turbo c++ 3.0 Date: Sun, 20 Jan 2002 00:11:45 +0800 Organization: IMS Netvigator Lines: 27 Message-ID: <a2c5ds$9nj1@imsp212.netvigator.com> NNTP-Posting-Host: pcd584121.netvigator.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000