在CI中可以做這樣的事情struct Point { int x,y;}struct Circle { struct Point p; // must be first! int rad;}void move(struct Point *p,int dx,int dy) { ....}struct Circle c = .....;move( (struct Point*)&c,1,2);使用這種方法,我可以傳遞任何以struct Point作為第一個成員的struct(Circle,Rectangle等)。我該如何在Google Go中執(zhí)行相同的操作?
- 2 回答
- 0 關(guān)注
- 243 瀏覽
添加回答
舉報
0/150
提交
取消