Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
C Programming

static in C

Use static for persistent locals and internal linkage at file scope.

static in C — a practical guide to C static keyword with clear examples you can reuse in real projects.

C Programming Tutorial Series (70/102). Prefer one article? Read the complete C programming tutorial.

Short description

static locals keep values between calls.

static local

void tick(void) {
    static int n = 0;
    n++;
    printf("%dn", n);
}

Leave a reply

Your email address will not be published. Required fields are marked *