Mail Archives: djgpp/2004/04/04/12:28:19
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
- Raw text -