delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/04/04/09:15:06

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: function question
Date: 4 Apr 2004 13:04:08 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 29
Message-ID: <c4p148$aff$5@nets3.rz.RWTH-Aachen.DE>
References: <106vune1fu63e7a AT corp DOT supernews DOT com>
NNTP-Posting-Host: accip02.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1081083848 10735 137.226.33.41 (4 Apr 2004 13:04:08 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 4 Apr 2004 13:04:08 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Bill Cunningham <nospam AT nspam DOT net> wrote:
>     I don't know if it would be better to post this here or comp.lang.c but
> I'll post it here since it's djgpp specific. 

It's not.  It's a *very* basic C question.

> int ma (int np[])
>         {puts("This is number of prices? -> ");
>          fflush(stdout);
>          puts(int *(np));}

> What this function is supossed to do is accept input of a number of prices
> an investor wants to include in a simple moving average. Hince the ma. The
> int * cast is the last thing to my knowledge to try. 

More to the point, the int * case you attempted to use isn't a cast at
all.  But that's not your problem at all.  That's rather that you're
using the *entirely* wrong standard library function.  You didn't
seriously expect the same function (puts) to both output a text and
read user input, did you?

> I know workable C. 

The kind of question you're asking here rather strongly hints that the
opposite of this is true.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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