“C Variável global” Respostas de código

como declarar variável global em c

You just need to declare a variable out of the function main in order to make it global.
Inquisitive Iguana

C Variável global

#include <stdio.h>
void display();

int n = 5;  // global variable

int main()
{
    ++n;     
    display();
    return 0;
}

void display()
{
    ++n;   
    printf("n = %d", n);
}
SAMER SAEID

Respostas semelhantes a “C Variável global”

Procure respostas de código populares por idioma

Procurar outros idiomas de código