[ create a new paste ] login | about

Link: http://codepad.org/8FIAgCq2    [ raw code | output | fork ]

iamyeasin - C++, pasted on Feb 2:
#include<bits/stdc++.h>

using namespace std;

int main()
{
    struct point
    {
        int x;
        int y;

        struct point *p;
    };

    typedef struct point pt;

    pt *mp;
    mp = (pt*) malloc(sizeof(pt));

    mp -> x = 10; //First Node
    mp -> y = 20;
    mp -> p = (pt*) malloc(sizeof(pt));


    mp -> p -> x = 30; //Second Node
    mp -> p -> y = 50;
    mp -> p -> p = (pt*)malloc(sizeof(pt));


    mp -> p -> p -> x= 100; // Third Node
    mp -> p -> p -> y= 200;
    mp -> p -> p -> p= NULL; // Finishing the node

    printf("%d %d\n",mp -> p -> p -> x,mp -> p -> p -> y);

    return 0;
}


Output:
1
Line 23: error: bits/stdc++.h: No such file or directory


Create a new paste based on this one


Comments: