Create global variable outside any function - C Function

C examples for Function:Global Variable

Description

Create global variable outside any function

Demo Code

#include <stdio.h>

int x = 9;/*from ww  w .ja  v a 2 s .  c  o m*/

void print_value(void)
{
    printf("%d\n", x);
}

int main( void )
{
    printf("%d\n", x);
    print_value();

    return 0;
}

Related Tutorials