首页 > 其他 > 详细

初始化结构体

时间:2016-10-17 00:02:23      阅读:158      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!