Timeline for Wire.write invalid conversion from ‘char*’ to ‘const uint8_t*
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 13, 2023 at 12:40 | history | edited | Michel Keijzers | CC BY-SA 4.0 |
added 80 characters in body
|
Jan 13, 2023 at 7:54 | comment | added | the busybee |
@user88434 Because C++ is a language with a kind of stronger type system, and by purpose the warning is enabled during compilation. You as the programmer need to make clear that you change the interpretation of the bytes. -- BTW, the clean solution would not use a C cast, but a C++ cast, for example Wire.write(reinterpret_cast<uint8_t*>(message), 4); .
|
|
Jan 13, 2023 at 2:31 | vote | accept | user88434 | ||
Jan 13, 2023 at 2:22 | comment | added | user88434 | But if they are the same, why is it complaining? | |
Jan 13, 2023 at 2:19 | history | answered | Michel Keijzers | CC BY-SA 4.0 |