0
Some function programmes prototype declared firsly but some programmes there has no function declaration but function is present
in c programming what is the rule of function declaration? please describe
1 Réponse
0
In C you can ‘prototype’ a function at the start of the file letting the compiler know that it exists and then define/implement it at the end of the file like so:
int add(int x, int y); // function prototype
int main() {
int a = add(4, 54);
}
int add(int x, int y) { // implementation
return x + y;
}
But you can also obviously just put the whole function at the top