标签:
//定义结构体 Point struct Point { int x; int y; }; void main() { Point pt; pt.x=5; pt.y=7; cout<<pt.x<<endl<<pt.y<<endl; } //-------------------------------------------------------------------- //定义结构体 Point struct Point { int x; int y; void output() { cout<<x<<endl<<y<<endl; } }; void main() { Point pt; pt.output(); //C++中允许结构体中包含函数,C语言中不可以 }
标签:
原文地址:http://www.cnblogs.com/ROHALLOWAY/p/4562114.html