{"id":253,"date":"2023-02-22T01:54:28","date_gmt":"2023-02-22T09:54:28","guid":{"rendered":"http:\/\/bitas.net.cn\/?page_id=253"},"modified":"2023-02-22T01:54:59","modified_gmt":"2023-02-22T09:54:59","slug":"069-2","status":"publish","type":"page","link":"http:\/\/bitas.net.cn\/index.php\/sourcecode\/069-2\/","title":{"rendered":"069 \u51fd\u6570\u8c03\u7528\u8fd0\u7b97\u7b26"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#include &lt;stdio.h>\n#include &lt;stdlib.h>\n\nstruct object {\n    int inArray;\n    union ID {\n        int index;\n        void * address;\n    } id; \n};\n\nstruct object * make_single_object()\n{\n    struct object * obj = malloc(sizeof(struct object));\n    if (obj) {\n        obj->inArray = 0;\n        obj->id.index = -1; \n        obj->id.address = obj;\n        return obj;\n    }   \n    else\n        return NULL;\n}\n\nint main(int argc, char *argv&#91;])\n{\n    struct object * obj;\n\n    if ((obj = make_single_object()) != NULL) {\n        printf(\"object address: %p\\n\", obj->id.address);\n        free(obj->id.address);\n    }   \n\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":127,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-253","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/pages\/253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/comments?post=253"}],"version-history":[{"count":1,"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/pages\/253\/revisions"}],"predecessor-version":[{"id":254,"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/pages\/253\/revisions\/254"}],"up":[{"embeddable":true,"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/pages\/127"}],"wp:attachment":[{"href":"http:\/\/bitas.net.cn\/index.php\/wp-json\/wp\/v2\/media?parent=253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}