The software I use doesn't tell me the meaning of the error messages when I compile the source code.
One error message that I dont understand is:
Error: Function has no prototype
What does this mean?
(does it mean it is not declared?)
thnx
Printable View
The software I use doesn't tell me the meaning of the error messages when I compile the source code.
One error message that I dont understand is:
Error: Function has no prototype
What does this mean?
(does it mean it is not declared?)
thnx
Yes. When function A uses function B then function B should be declared before function A or a prototype of function B should appear before function A.
hI,
you have either forgot to use the #include header file for the function OR have forgot to print your own prototype in your program.
Code:
int add (int x, int y); /*this is the prototype for function add*/
int main ()
{
int a = 10, b = 15, answer = 0;
answer = add(a, b);
printf("This printf doesnot work until I #include <stdio.h>");
return 0;
}
int add (int *x, int *y)
{
return (x + y);
}