Well, if you want the difference to matter, I would expect that you need more than one source file. For example:
Code:
/* main.c */
#include <stdio.h>
#include "test_header.h"
int main(void)
{
printf("Global: %u at %p\n", a, (void*)&a);
printf("Static Global: %u at %p\n", b, (void*)&b);
modify_a(123);
modify_b(456);
printf("Global: %u at %p\n", a, (void*)&a);
printf("Static Global: %u at %p\n", b, (void*)&b);
return 0;
}
Code:
#ifndef TEST_HEADER_H_
#define TEST_HEADER_H_
/* test_header.h */
extern unsigned int a;
static unsigned int b;
void modify_a(unsigned int new_a);
void modify_b(unsigned int new_b);
#endif
Code:
/* test_source.c */
#include "test_header.h"
unsigned int a;
void modify_a(unsigned int new_a)
{
a = new_a;
}
void modify_b(unsigned int new_b)
{
b = new_b;
}