All pastes #162847 Raw Edit

Something

public cpp v1 · immutable
·published 2006-09-06 22:08 UTC
rendered paste body
#include <stdio.h>class coords{        public:        int x;        int y;        coords(int X, int Y) : x(X), y(Y) { }        int* get()        {                static int temp[2];                temp[0] = x;                temp[1] = y;                return temp;        }};int main(void){        coords f(1,1);        coords g(2,2);        int* p = f.get();        int* q = g.get();        q[0] = 10;        printf("(%d,%d), (%d,%d)\n", p[0], p[1], q[0], q[1]);        return 0;}