glibg10b
link
fedilink
0
edit-2
9M

1

2 is a function header followed by the opening curly brace of a function body

LalSalaamComrade
cake
creator
link
fedilink
09M

In case if a function prototype is not used, then what about that scenario? Is the information in the function header used?

If a function is declared but not implemented it’ll usually cause a linking error… And sometimes (with older compilers) a runtime error.

The standard here is that the declaration (1) would be in a .h file that other .c files might reference while the implementation (2) would be in a .c so it is only built once into a .o file during compilation & linking.

General Programming Discussion
!programming@lemmy.ml

    A general programming discussion community.

    Rules:

    1. Be civil.
    2. Please start discussions that spark conversation

    Other communities

    Systems

    Functional Programming

    Also related

    • 0 users online
    • 6 users / day
    • 7 users / week
    • 21 users / month
    • 111 users / 6 months
    • 1 subscriber
    • 326 Posts
    • 596 Comments
    • Modlog