- 1
What does it mean when error says function should have a prototype????
3 Réponses
+ 2
Simply means that the function you called is written after where you called it from so the program doesnt know about it. you need to give it a prototype so the compiler knows what it is.
for example:
void myfunction2(); // prototype <---
void myfunction1()
{
// call my function 2
myfunction2();
}
void myfunction2()
{
cout << "Hello";
}
+ 2
Yes,but how to do that?
+ 1
If your Program has a function and the definition of that function is given after main() then you will have to give a prototype of that function before main() function so that the compiler does not get confused.