C++之结构体的另类使用

来源:互联网 发布:淘宝宝贝详情图尺寸 编辑:程序博客网 时间:2024/05/22 07:08

此程序模仿MFC中的消息映射方法而写

#include<iostream>using namespace std;struct node{int x;double y;};void main(){struct node _node[]={5,5.0,    8,8.0,9,9.0};int n=sizeof(_node)/sizeof(_node[0]);for(int i=0;i<n;i++){cout<<_node[i].x<<_node[i].y<<endl;}}


0 0