logoalt Hacker News

zabzonktoday at 6:54 PM1 replyview on HN

you can access it using extern from anywhere:

    // a.c
    int f( int x ) {
        return x + 1;
    }

    // b.c
    extern int f(int x );

    int main() {
        int y = f(41);
    }
but if f() had been defined as static, you couldn't do this.

Replies

bigfishrunningtoday at 7:03 PM

"private function" doesn't mean "you can't know about this", it means "you shouldn't rely on this as a stable interface to my code".

Just because you can use the information you have to call a given function, doesn't mean you aren't violating an interface.

show 1 reply