how to convert char array to const byte array in C
-
I need to use function byte*strcat(byte*, const byte*)in following strcat(byte* dest, ":"); I receive following warning: warning C4133: 'function' : incompatible types - from 'char [2]' to 'const byte *' How to resolve this problem?
how's defined your type
byte
? have you tried to explicitely cast to (char*) and (const char*) respectedly ? moreover, what doest that mean :strcat(byte* dest, ":");
is it how you call your function ??? :wtf: oh, and at last, it is a warning, not an error, so, nothing blocking !
Don't know where to start ?
Refer the Forums Guidelines and ask a friend -
I need to use function byte*strcat(byte*, const byte*)in following strcat(byte* dest, ":"); I receive following warning: warning C4133: 'function' : incompatible types - from 'char [2]' to 'const byte *' How to resolve this problem?
lose the 'byte *'. Calls should not contain thier datatype unless you are specifically casting it to that type and then you need to wrap the data type in parenthesis or angle brackets. such that, strcat(byte* dest, ":"); becomes, strcat((byte*) dest, ":"); /*byte* is 'casted'*/ Otherwise, just plan ol' remove the byte* from your statement, resulting in: strcat(dest, ":"); Ideally, you should ensure your datatypes are the same whereever possible.