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 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
.