SORU
15 Mart 2011, Salı


C statik işlev

Bir fonksiyonu C statik yapmanın anlamı nedir?

CEVAP
15 Mart 2011, Salı


Diğer çeviriler adet görmemem: sarma.

helper_file.c

int f1(int);        /* prototype */
static int f2(int); /* prototype */

int f1(int foo) {
    return f2(foo); /* ok, f2 is in the same translation unit */
                    /* (basically same .c file) as f1         */
}

int f2(int foo) {
    return 42   foo;
}

ana.c:

int f1(int); /* prototype */
int f2(int); /* prototype */

int main(void) {
    f1(10); /* ok, f1 is visible to the linker */
    f2(12); /* nope, f2 is not visible to the linker */
    return 0;
}

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Jose LviS el Bambino ( JLB )   LviSito

    Jose LviS el

    3 ŞUBAT 2008
  • Candyrat Records

    Candyrat Rec

    10 Mayıs 2006
  • wwjoshdu

    wwjoshdu

    18 ŞUBAT 2011