Let see the code below.
#include <stdio.h>
int main(void) {
// your code goes here
printf("%d\n", func());
return 0;
}
int func() {
return 10;
}
Can we run this code and get no error?
Let see the code below.
#include <stdio.h>
int main(void) {
// your code goes here
printf("%d\n", func());
return 0;
}
int func() {
return 10;
}
Can we run this code and get no error?
I think we can do that by declare a prototype of 'func ’ before main function like this:
int func();
is it solution?
First seen, No f way :))
After compiled: ⊙_⊙ Wot? How?
This topic sholve this issue.
Conclusion:
In C, we can call an undeclared function, but we can’t do this in C++.


OMG, how stupid i’m 
Your answer is true. This is just a trick in C. Don’t worry about that.
I am the same you before found this issue.
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?