modernc.org/ccgo/v3@v3.16.14/lib/testdata/tcc-0.9.27/tests/tests2/10_pointer.c (about)

     1  #include <stdio.h>
     2  
     3  struct ziggy
     4  {
     5     int a;
     6     int b;
     7     int c;
     8  } bolshevic;
     9  
    10  int main()
    11  {
    12     int a;
    13     int *b;
    14     int c;
    15  
    16     a = 42;
    17     b = &a;
    18     printf("a = %d\n", *b);
    19  
    20     bolshevic.a = 12;
    21     bolshevic.b = 34;
    22     bolshevic.c = 56;
    23  
    24     printf("bolshevic.a = %d\n", bolshevic.a);
    25     printf("bolshevic.b = %d\n", bolshevic.b);
    26     printf("bolshevic.c = %d\n", bolshevic.c);
    27  
    28     struct ziggy *tsar = &bolshevic;
    29  
    30     printf("tsar->a = %d\n", tsar->a);
    31     printf("tsar->b = %d\n", tsar->b);
    32     printf("tsar->c = %d\n", tsar->c);
    33  
    34     b = &(bolshevic.b);
    35     printf("bolshevic.b = %d\n", *b);
    36  
    37     return 0;
    38  }
    39  
    40  // vim: set expandtab ts=4 sw=3 sts=3 tw=80 :