两个节点链接成的氧气

#include <windows.h>
#include <stdio.h>

struct node
{
    struct node * ppre;
    struct node * pforward;
    int data;
};

int main() {

    struct node O_Node1 ,O_Node2;
    O_Node1.pforward = &O_Node2;
    O_Node1.ppre     = &O_Node2;
    O_Node2.ppre     = &O_Node1;
    O_Node2.pforward = &O_Node1;

    O_Node1.data = 'O';
    O_Node2.data = 'O';

    while (1) {

        int i = 0;  //
        while (1)
        {
            printf("O_Node2.pforward  is %c\n", O_Node1.pforward->data);
            Sleep(1000);
            printf("O_Node1.pforward  is %c\n", O_Node2.pforward->data);
        }

    }
}


digraph O__0_Struct

{


  O1->O2;  O2->O1;


}




posted @ 2020-03-08 14:36  卷哭你  阅读(109)  评论(0编辑  收藏  举报