boot2

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

011-struct.c (336B)


      1 /* tests/cc-e2e/11-struct.c — local struct with positional initializer.
      2  * Split from 01-kitchen-sink. */
      3 
      4 struct Point { int x; int y; };
      5 
      6 int test_struct(void) {
      7     struct Point local = { 3, 4 };
      8     return local.x + local.y;       /* 7 */
      9 }
     10 
     11 int main(int argc, char **argv) {
     12     if (test_struct() != 7) return 1;
     13     return 0;
     14 }