Skip to content
Snippets Groups Projects
Select Git revision
  • e02488e7ac3d5a271b6a27a0ab1b03698554ad45
  • master default protected
  • 2018ws
  • 2017ws
  • 2016ws
5 results

functions-5.c

Blame
  • Forked from Peter Gerwinski / hp
    290 commits behind the upstream repository.
    functions-5.c 403 B
    #include <stdio.h>
    
    int a = 0, b = 3;
    
    void foo (void)
    {
      b++;
      static int a = 5;
      int b = 7;
      printf ("foo(): a = %d, b = %d\n", a, b);
      a++;
    }
    
    int main (void)
    {
      printf ("main(): a = %d, b = %d\n", a, b);
      foo ();
      printf ("main(): a = %d, b = %d\n", a, b);
      a = b = 12;
      printf ("main(): a = %d, b = %d\n", a, b);
    /*
      foo ();
      printf ("main(): a = %d, b = %d\n", a, b);
    */
      return 0;
    }