delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/27/07:00:53

From: fiammy AT my-dejanews DOT com
Newsgroups: comp.os.msdos.djgpp
Subject: Re: I need help adressing characters in a string
Date: Tue, 27 Apr 1999 10:24:51 GMT
Organization: Deja News - The Leader in Internet Discussion
Lines: 33
Message-ID: <7g439h$dk3$1@nnrp1.dejanews.com>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990426134857 DOT 22711F-100000 AT is>
NNTP-Posting-Host: 193.190.224.124
X-Article-Creation-Date: Tue Apr 27 10:24:51 1999 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)
X-Http-Proxy: 1.1 x13.dejanews.com:80 (Squid/1.1.22) for client 193.190.224.124
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> On Mon, 26 Apr 1999 fiammy AT my-dejanews DOT com wrote:
>
> > I want to use the characters in a string separately, so I thought I just use
> > the string as an array of characters, but DJGPP gives me problems. When I
add
> > the nuber of the character to the string, I just get garbage, what do I have
> > to do to be able to use the characters in a loop that processes one at a
> > time?
>
> Consider to always post some example code when you ask such questions.
> Otherwise, there's high risk that people won't even understand what you
> are trying to accomplish, let alone what your problems are.
>

Well, consider this :

char *string;

void main (void)
{
 int i;
 for (i=; i=lengthof(string); i++)
  {
  dosomething with string[i];
  }

I can't do that, the compiler gives me an error.

How should I declare the string?

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

- Raw text -


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