glibg10b
link
fedilink
0
edit-2
10M

1

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

@velox_vulnus@lemmy.ml
creator
link
fedilink
0
edit-2
8d

deleted by creator

@xmunk@sh.itjust.works
link
fedilink
1
edit-2
10M

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
    • 5 users / day
    • 14 users / week
    • 44 users / month
    • 138 users / 6 months
    • 1 subscriber
    • 336 Posts
    • 544 Comments
    • Modlog