delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/17/14:31:05

From: Endlisnis <s257m AT unb DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Probs w/command line args
Date: Mon, 17 Aug 1998 14:58:50 -0300
Organization: NBTel Internet
Lines: 19
Message-ID: <35D86F59.DBAD19B1@unb.ca>
References: <6r7umj$tf9$1 AT nnrp1 DOT dejanews DOT com>
NNTP-Posting-Host: fctnts11c10.nbnet.nb.ca
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

lawrencej AT ufrsd DOT k12 DOT nj DOT us wrote:

> for (c=1; c<argc; c++)
>    {
>     strcat (txt, argv[c]);
>     if (c!=argc)  strcat (txt, " ");
>    }

    The if statement will ALWAYS be true, you will always add an extra space on
the end.if(c<argc-1) is what you want.
--
     (\/) Endlisnis (\/)
          s257m AT unb DOT ca
          Endlisnis AT GeoCities DOT com
          Endlis AT nbnet DOT nb DOT ca




- Raw text -


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