Git Product home page Git Product logo

Comments (2)

Konstantin8105 avatar Konstantin8105 commented on May 31, 2024
struct y;
struct x { struct y *p; /* ... */ };
struct y { struct x *q; /* ... */ };

int vv(){
struct y;
struct x2 { struct y *p2; /* ... */ };
struct y { struct x2 *q; /* ... */ };
}

from c4go.

Konstantin8105 avatar Konstantin8105 commented on May 31, 2024
// Link: http://en.cppreference.com/w/c/language/struct
struct yS;
struct x  { struct yS *p;  int ax;};
struct yS { struct x  *q;  int ay;};

int test_vv(){
       struct yS var_y;
       struct x  var_x;
       var_x.p = &var_y;
       var_x.ax = 10;
       var_y.q = &var_x;
       var_y.ay = 42;
       is_eq(var_x.ax , 10);
       is_eq((*var_x.p).ay , 42);
       
       struct yS;
       struct x2  { struct yS *p2; float bx2; };
       struct yS  { struct x2  *q; float by ; };

       struct yS var_y2;
       struct x2 var_x2;
       var_x2.p2 = &var_y2;
       var_x2.bx2 = 100;
       var_y2.q = &var_x2;
       var_y2.by = 420;
       is_eq(var_x2.bx2 , 100);
       is_eq((*var_x2.p2).by , 420);
}

from c4go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.