- Joined
- Aug 1, 2020
- Posts
- 3,056
- Solutions
- 2
- Reaction
- 18,653
- Points
- 2,656
Good Morning ka Phc! Tanong ko lang po why we need to prototype when we declare a function in C don't know sa C++, na pwed naman nasa una yung function na gusto mo ng e declare before sa int main() na function.
Example:
instead na mag prototype kapa
Example:
Code:
#include <stdio.h>
void myFunction()
{
printf("My Function");
}
int main()
{
printf("My Main");
return 0;
}
instead na mag prototype kapa
Code:
#include <stdio.h>
void myFunction(void);
int main()
{
printf("My Main");
return 0;
}
void myFunction()
{
printf("My function");
}