🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.lang.c
Article #15560

Re: conjugaison et autres exos sur les chaines [Was : Un système de conj...]

#15560
From: Pierre Habouzit
Date: Sun, 18 Sep 2005 23:01
41 lines
2813 bytes
Emmanuel Delahaye wrote:

> Pierre Habouzit wrote on 18/09/05 :
>>     if (argc > 0) {
> Hum...
>>         printf("%s\n", argv[argc]);
> 
> argv[argc] vaut NULL par d�finition...

arf oui, tr�s juste. j'�tais tellement pr�occup� de sauter argv[0] que j'ai
dit de la merde ... bref, il faut remplacer toutes les occurences de argc
dans le corps de main par argc-1.

soit la version correcte :

========

#include <stdio.h>

int main(int argc, char **argv)
{
    int n;

    for (n = 1; n < argc-1; n++) {
        printf("%s ", argv[n]);
    }
    if (argc > 1) {
        printf("%s\n", argv[argc-1]);
    }

    return 0;
}

========

bref, promis, la prochaine fois je teste �a dans un shell au lieu de poster
des b�tises ;(
-- 
�O�  Pierre Habouzit
��O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Technical Details
Message-ID: <432df189$0$2933$626a14ce@news.free.fr>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!nocworld.net!freenix!gandi!gandi.net!proxad.net!infeed-1.proxad.net!news18-e.free.fr!not-for-mail
References: <1126342327.583568.21420@g43g2000cwa.googlegroups.com> <4329e5d4$0$7846$8fcfb975@news.wanadoo.fr> <dge4b6$fqa$1@reader1.imaginet.fr> <mn.837a7d59123d924a.15512@YOURBRAnoos.fr> <432adddf$0$17220$8fcfb975@news.wanadoo.fr> <mn.84407d597cfa6e6e.15512@YOURBRAnoos.fr> <432b2a92$0$7861$8fcfb975@news.wanadoo.fr> <432c19e0$0$1710$8fcfb975@news.wanadoo.fr> <432cad90$0$27422$8fcfb975@news.wanadoo.fr> <432d1b7c$0$1743$8fcfb975@news.wanadoo.fr> <432d3117$0$1742$8fcfb975@news.wanadoo.fr> <mn.93877d590449a7bc.15512@YOURBRAnoos.fr> <432d7667$0$17248$8fcfb975@news.wanadoo.fr> <mn.94047d599f0cc076.15512@YOURBRAnoos.fr> <432da70c$0$1735$8fcfb975@news.wanadoo.fr> <432dd52f$0$622$626a14ce@news.free.fr> <mn.95687d59be8517f2.15512@YOURBRAnoos.fr>

Show Full Headers
Complete Article Headers
X-Google-Thread: f9822,b21b26167a936e28
X-Google-Attributes: gidf9822,public
X-Google-Language: FRENCH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!nocworld.net!freenix!gandi!gandi.net!proxad.net!infeed-1.proxad.net!news18-e.free.fr!not-for-mail
Message-ID: <432df189$0$2933$626a14ce@news.free.fr>
Supersedes: <432df178$0$2933$626a14ce@news.free.fr>
From: Pierre Habouzit <madcoder@debian.org>
Subject: Re: conjugaison et autres exos sur les chaines [Was : Un système de conj...]
Newsgroups: fr.comp.lang.c
Date: Mon, 19 Sep 2005 01:01:25 +0200
References: <1126342327.583568.21420@g43g2000cwa.googlegroups.com> <4329e5d4$0$7846$8fcfb975@news.wanadoo.fr> <dge4b6$fqa$1@reader1.imaginet.fr> <mn.837a7d59123d924a.15512@YOURBRAnoos.fr> <432adddf$0$17220$8fcfb975@news.wanadoo.fr> <mn.84407d597cfa6e6e.15512@YOURBRAnoos.fr> <432b2a92$0$7861$8fcfb975@news.wanadoo.fr> <432c19e0$0$1710$8fcfb975@news.wanadoo.fr> <432cad90$0$27422$8fcfb975@news.wanadoo.fr> <432d1b7c$0$1743$8fcfb975@news.wanadoo.fr> <432d3117$0$1742$8fcfb975@news.wanadoo.fr> <mn.93877d590449a7bc.15512@YOURBRAnoos.fr> <432d7667$0$17248$8fcfb975@news.wanadoo.fr> <mn.94047d599f0cc076.15512@YOURBRAnoos.fr> <432da70c$0$1735$8fcfb975@news.wanadoo.fr> <432dd52f$0$622$626a14ce@news.free.fr> <mn.95687d59be8517f2.15512@YOURBRAnoos.fr>
User-Agent: KNode/0.9.2
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8Bit
X-Face: $(^e[V4D-[`f2EmMGz@fgWK!e.B~2g.{08lKPU(nc1J~z\4B>*JEVq:E]7G-\6$Ycr4<;Z!|VY6Grt]+RsS$IMV)f>2)M="tY:ZPcU;&%it2D81X^kNya0=L]"vZmLP+UmKhgq+u*\.dJ8G!N&=EvlD
Lines: 41
Organization: Guest of ProXad - France
NNTP-Posting-Date: 19 Sep 2005 01:00:25 MEST
NNTP-Posting-Host: 82.225.205.10
X-Trace: 1127084425 news18-e.free.fr 2933 82.225.205.10:55357
X-Complaints-To: abuse@proxad.net