delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/10/12:09:23

Date: Sat, 10 Jun 2000 18:05:48 +0200 (MET DST)
From: pad2369 <pad2369 AT iperbole DOT bologna DOT it>
Message-Id: <200006101605.SAA17378@maggiore.iperbole.bologna.it>
To: djgpp AT delorie DOT com, Rogerio Mazakina <dway AT designer DOT mailbr DOT com DOT br>
References: <393FF15E DOT C39C0175 AT gtcom DOT net> <200006090758 DOT KAA06169 AT alpha DOT netvision DOT net DOT il> <3940B899 DOT 8A8C3AD3 AT gtcom DOT net> <200006091445 DOT RAA32490 AT alpha DOT netvision DOT net DOT il> <39419803 DOT 221A0CE2 AT gtcom DOT net> <009a01bfd2e2$8af950a0$817a5a8f AT dynabook>
In-Reply-To: <009a01bfd2e2$8af950a0$817a5a8f@dynabook>
MIME-Version: 1.0
User-Agent: IMP/PHP3 Imap webMail Program 2.0.11
Sender: pad2369 AT iperbole DOT bologna DOT it
Subject: Re: search \n and print in a new line
Reply-To: djgpp AT delorie DOT com

Rogerio Mazakina <dway AT designer DOT mailbr DOT com DOT br>:
> Hello.
[...]
> I tried this ...
> 
> for(i=0; i<10; i++, a++)
>   if (string[i] == "\n") break;

Here you are comparing a char with a string 8ie: a 
pointer to char). Try this:

   if (string[i] == '\n') break;

>   else t_string[a] = string[i];

ciao
  Giacomo
-----------------------------------------------------
Giacomo Degli Esposti - pad2369 AT iperbole DOT bologna DOT it

- Raw text -


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