Mail Archives: djgpp/1998/06/16/14:31:32
From: | Bjorn De Meyer <bgdmeyer AT eduserv2 DOT rug DOT ac DOT be>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Input Parsing problem
|
Date: | Mon, 15 Jun 1998 11:51:32 +0200
|
Organization: | University of Ghent, Belgium
|
Lines: | 34
|
Message-ID: | <Pine.GSO.3.96.980615114220.24934B-100000@eduserv2.rug.ac.be>
|
References: | <6lv1qf$nfu$2 AT News DOT Dal DOT Ca>
|
NNTP-Posting-Host: | eduserv2.rug.ac.be
|
Mime-Version: | 1.0
|
In-Reply-To: | <6lv1qf$nfu$2@News.Dal.Ca>
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
On 13 Jun 1998, Blake McCurdy wrote:
> I have a small problem. I have an array of 80 characters. Is there anyway
> to to input some stuff, and then place a terminating '\0' at the end of
> the input, not at the end of the 80 char array? If this sounds abstract,
> here's the real problem. I want to input a line of text into one array,
> and then parse it into 5 different arrays, one word each, and count the
> number of words as I go. Here's the source. It works most of the time, but
> sometimes rawPhrase has garbage in it. It's all part of a Phrase class.
<snip>
You are doing it quite complex here to parse a sentence.
There is a parsing function in the Gnu libc wich is very useful.
It's called strsep(). You'll have to include string.h , I think.
HTH CIA.
Bjorn De Meyer.
IA #i^4
Homepage: http//studwww.rug.ac.be/~bgdmeyer
E-mail: bjorn DOT demeyer AT rug DOT ac DOT be
Chemistry student at RUG, option polymers.
Coordinator of the "Tales of Artah: First Sword" CRPG project.
"I've shaven. I'm happy. I have no religion. Don't pray for me."
Illusion of Gaia 2
- Raw text -