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

c 结构体

时间:2019-06-28 00:59:22      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:int   struct   span   nta   origin   bsp   ret   结构体   puts   

 

#include <stdio.h>      /* puts, printf */
#include <time.h>       /* time_t, struct tm, time, localtime */
struct Position{
    double x;
    double y;
    double z;
};
struct Orientation{
    double w;
    double x;
    double y;
    double z;
};
struct pose{
    Position position;
    Orientation orientation;
};
//cur
//orientation: {w: 0.25, x: 0.0, y: 0.0, z: 0.97}
//position: {x: -4.95, y: -2.07, z: 0.0}

//origin
//-8.750273, -10.928155
int main ()
{
    pose cur;
    cur.position.x=-4.95;
    cur.position.y=-2.07;
    cur.position.z=0.0;
    cur.orientation.w=0.25;
    cur.orientation.x=0.0;
    cur.orientation.y=0.0;
    cur.orientation.z=0.97;
    
    pose origin;
    origin.position.x=-8.75;
    origin.position.y=-10.93;
    origin.position.z=0.0;
    origin.orientation.w=0.0;
    origin.orientation.x=0.0;
    origin.orientation.y=0.0;
    origin.orientation.z=0.0;
    
    return 0;
}

 

c 结构体

标签:int   struct   span   nta   origin   bsp   ret   结构体   puts   

原文地址:https://www.cnblogs.com/sea-stream/p/11100363.html

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