64,643
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
typedef enum coltype
{
TYPE_TIME = 0,
TYPE_INT,
TYPE_DOUBLE,
TYPE_STRING
}Coltype;
typedef enum colunit
{
UNIT_1,
UNIT_2,
UNIT_3
}Colunit;
struct col_info
{
char *name;
Coltype type;
Colunit unit;
double precision;
long long scope;
};
int main()
{
struct col_info *col1 = new struct col_info;
col1->name = "col1fff";
col1->precision = 0.0;
col1->scope = 10;
col1->type = TYPE_TIME;
struct col_info *col2 = new struct col_info;
col1->name = "col2";
col1->precision = 0.0;
col1->scope = 10;
col1->type = TYPE_INT;
struct col_info *col3 = new struct col_info;
col1->name = "col3";
col1->precision = 0.0;
col1->scope = 10;
col1->type = TYPE_STRING;
cout<<col1->name<<endl;
cout<<col2->name<<endl;
cout<<col3->name<<endl;
system("pause");
return 0;
}