码迷,mamicode.com
首页 > 其他好文 > 详细

初始化结构体

时间:2016-10-17 00:03:53      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:

typedef struct { /* RTK control/result type */
sol_t sol; /* RTK solution */
double rb[6]; /* base position/velocity (ecef) (m|m/s) */
int nx, na; /* number of float states/fixed states */
double tt; /* time difference between current and previous (s) */
double *x, *P; /* float states and their covariance */
double *xa, *Pa; /* fixed states and their covariance */
int nfix; /* number of continuous fixes of ambiguity */
ambc_t ambc[MAXSAT]; /* ambibuity control */
ssat_t ssat[MAXSAT]; /* satellite status */
int neb; /* bytes in error message buffer */
char errbuf[MAXERRMSG]; /* error message buffer */
prcopt_t opt; /* processing options */
} rtk_t;

rtk_t *rtk;
rtk = (rtk_t *)malloc(sizeof(rtk_t));

sol_t sol0 = { { 0 } };
ambc_t ambc0 = { { { 0 } } };
ssat_t ssat0 = { 0 };

直接赋值0就行了,不用搞七搞八。

初始化结构体

标签:

原文地址:http://www.cnblogs.com/liuqi375548699/p/5968083.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!