开发者

doesn't know a type (casting)

开发者 https://www.devze.com 2023-02-03 20:22 出处:网络
I want to add a variable in a message header so I used unit8_t to define them but when I want to read this variable I need to cast it in double I did:

I want to add a variable in a message header so I used unit8_t to define them but when I want to read this variable I need to cast it in double I did:

hello.positionx = unit8_t (m_ipv4->GetObject<MobilityModel> ()->Get开发者_开发问答Position ().x);   
hello.positiony = unit8_t (m_ipv4->GetObject<MobilityModel> ()->GetPosition ().y);   

as you can see these lines are similar but when I run my program it shows an error in second line which : unit8_t in not defined in this scope

I added the Header :

 #include"stdint.h"  

I don't know, what's the meaning of this error. I will be thankful if you help me .


The name of the type is uint8_t, which stands for "unsigned integer, 8 bits wide". You seem to have mistyped it.

0

精彩评论

暂无评论...
验证码 换一张
取 消