Mail Archives: djgpp/1997/01/05/22:31:56
wildthing AT value DOT net (Wild Thing) wrote:
>Whenever I prototype a function in DJGPP, RHIDE tells gives me a
>warning when I try to compile the program.
>for example:
>// my c program
>#include <stdio.h>
>#include <conio.h>
>newFunction(int i); // prototype
>main()
>{
> int i = 5;
> clrscr();
> printf("blah blah");
> newFunction(i);
> return 0;
>}
>newFunction(int i)
>{
> printf(" %d", i);
> return 0;
>}
>sorry about the bad example, i'm just learning c and had to think of
>it off the top of my head.. anyhow, when i try to compile it under
>rhide with djgppv2 it says "warning: newFunction() has no data type or
>something or other".. but the program works fine if i remove the
>prototype at the top.. is this normal?
I don't know if it's the cause of your problem, but you don't declare
the return data type in either the prototype or the function
definition. Try:
int newFunction(int i);
as the function prototype.
- Raw text -