How is a function definition defined after its use in a function call?

Consider this code:

int main()
{
        int e;
        prn(e);
        return 0;
}

void prn(double x,int t)
{
}

Why does this code contain the following warnings and errors?

m.c:9: warning: conflicting types forprnm.c:5: note: previous implicit declaration ofprnwas here

Should the "undefined" function be used?

+5
source share
2 answers

In C99, it should receive an undeclared functional error.

C89/90 . , , int, , . , , . , , undefined. .

, . prn(e), , prn - int prn(int). , void prn(double, int). .

, , . , . prn , , undefined .

+11

C89 . , , int prn(). ( ), .

, " ", " ". , ( ), .

C99 "" . , C89 C-. , C , .

+6

All Articles