🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2273

Re: a problem with printf

#2273
From: walter briscoe
Date: Thu, 14 Mar 1996 02:20
63 lines
1973 bytes
In article <4i6hn8$pc9@solutions.solon.com> motte@ens.lifl.fr  writes:

> Hello,
> 
> I post the code as you asked me.
> The problem is in the main function.
> Now it does not run but if I let the line impr(essai) it does run very well.
> If you do not find the solution, do not worry, my teacher could not solve
> this problem.
> 
> thanks.
> 
> 
> PS : sorry, but I do not speak english very well.
> ----------

Meiux que je parle francais. J'ai essaye pc-lint. Il a trouve

[snip]

> void echanger ( fichier *f1, fichier *f2 )
> {
>   fichier *tmp;
>   *tmp=*f1; /* tmp n'indique rien ici */
>   *f1=*f2;
>   *f2=*tmp;
> }

j'ai essaye

void echanger ( fichier *f1, fichier *f2 )
{
  fichier *tmp;
  tmp=*f1;
  *f1=*f2;
  *f2=tmp;
}

Tout sera bien.

Il y a aussi:

void echanger ( fichier *f1, fichier *f2 )
{
  fichier *tmp;
  tmp=f1;
  f1=f2;
  f2=tmp;
}

Mais, ca fait rien!!

[While this is not a French newsgroup, I let people post in English, so...
 -mod]

Please, O Moderator, allow me to practice my French.  Once lint had
pointed at the problem, it was easy to find plausible solutions.  There
is also Flexelint for those without access to a PC to check code.

I would be interested in a tool which would detect the problem in the
third version of "echanger".  Pc-lint/Flexelint do not.
--
walter briscoe
Technical Details
Message-ID: <4i7vpu$432@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4i6hn8$pc9@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: walter briscoe <walter@wbriscoe.demon.co.uk>
Newsgroups: comp.lang.c.moderated
Subject: Re: a problem with printf
Date: 13 Mar 1996 20:20:46 -0600
Organization: Digital Solutions
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4i7vpu$432@solutions.solon.com>
References: <4i6hn8$pc9@solutions.solon.com>
Reply-To: walter@wbriscoe.demon.co.uk
NNTP-Posting-Host: solutions.solon.com
X-NNTP-Posting-Host: wbriscoe.demon.co.uk
X-Newsreader: Demon Internet Simple News v1.30
X-Mail2News-Path: wbriscoe.demon.co.uk