boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

091-multi-decl.c (400B)


      1 /* Multiple declarators in one declaration: int a=1, b=2, c=3; */
      2 
      3 int g_a = 1, g_b = 2, g_c = 3;
      4 
      5 int main(int argc, char **argv) {
      6     if (g_a + g_b + g_c != 6) return 1;
      7     int a = 10, b = 20, c;
      8     c = a + b;
      9     if (c != 30) return 2;
     10     /* Mixed types via pointers in same decl. */
     11     int x = 5;
     12     int y = 7, *p = &x;
     13     if (*p != 5) return 3;
     14     if (y != 7)  return 4;
     15     return 0;
     16 }