1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#include <iostream.h> struct point { int x; int y; void output() { cout << x << endl << y << endl; } }; void main() { point pt; pt.x = 5; pt.y = 5; pt.output(); } |
转载请注明:exchen's blog » C++ 结构体函数