Posted to tcl by hat0 at Fri Nov 30 02:28:49 GMT 2007view raw
- struct xy { int x,y; };
- struct xy make_xy(int x,int y) {
- struct xy my;
- my.x = x;
- my.y = y;
- return my;
- }
- void set_xy(struct xy &my,int x,int y) {
- my.x = x;
- my.y = y;
- }
- struct xy test[3];
- test[0] = make_xy(1,2);
- puts("test is ${test}");
- set_xy(&test[1], 2, 3);
- puts("test is ${test}");