添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
怕考试的熊猫  ·  JSON | Grafana k6 ...·  5 月前    · 
爱喝酒的核桃  ·  美国奥本大学Dongye ...·  7 月前    · 
讲道义的闹钟  ·  Úvodem | laboroatelier.cz·  7 月前    · 
销魂的香菜  ·  巴林农产品进口市场·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Incompatible pointer to integer conversion initializing 'UInt8' (aka 'unsigned char') with an expression of type 'UInt8 [15]

What type do I need to cast to in order to compile? I have tried adding [15] subscript in different places and could not solve it. Also an explanation of what [15] means in UInt8 c[15];

Thanks

I guess packet is declared as myStruct packet; . If so, packet->c is an array of UInt8 , you can store up to 15 items in this member. That's why you cannot assign it's value to a single UInt8 . Replace UInt8 c = packet->c; with UInt8* c = packet->c; . To get the first c 's item use the following code: UInt8 firstC = c[0]; .

Thanks for the answer.How could I assign value to struct member c ? When I try myStruct.c = value; I get the following error Array type 'UInt8 [15]' is not assignable . But I cn assign values to single UInt8 's. AnonProgrammer Aug 26, 2019 at 14:03

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .