Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

#define SOMETHING of type int16_t

Tags:

c

macros

How does one define different types of ints?

I have the following

struct movCommand
{
    uint8_t type;
    uint8_t order;
    int16_t height;
    uint16_t distance;
    int16_t yaw;
};

and need to define these according to the types they are.

What is the correct syntax for #define when selecting the type for the define?

EDIT :

It looks like my question has been misunderstood.

I want to do this #define LANDING_COMMAND "2" But I want to set the type of the landing command because it needs to be int16_t

like image 778
some_id Avatar asked Dec 28 '22 20:12

some_id


1 Answers

You do not use #define for this. You #include <stdint.h>

like image 64
R.. GitHub STOP HELPING ICE Avatar answered Dec 30 '22 10:12

R.. GitHub STOP HELPING ICE