X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Message-ID: <407036F2.8005C632@alltel.net> Date: Sun, 04 Apr 2004 11:25:22 -0500 From: Curtis Mackie X-Mailer: Mozilla 4.5 [en]C-Alltel IS (Win98; I) X-Accept-Language: en-US, en-GB, en MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: function question References: <106vune1fu63e7a AT corp DOT supernews DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Here's your problem: puts(int * (np));} Replace it with: puts((int *) (np));} If that doesn't work, try: puts(&np); They way you have it worded, the compiler thinks you're passing a new undeclard int* to puts() - which is, of course, copmletely absurd, not to mention illegal. Bill Cunningham 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. I'm working on some open source > programming and seem to have run up against a wall. Can anyone give me any > pointers(no pun intended) on this. > > 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. I know workable C. I'm > not really experienced with the fancy ins and outs. As the funcion > continues, it should tally a number of prices and calculate a ma. Then I'll > include it into a static library where it can be linked with a file > containing main(). > > Bill