vendredi 30 septembre 2016

error: invalid conversion from 'unsigned char*' to 'const signed char*'

uint8_t* buf1;
...
const signed char* buf2 = static_cast<const signed char*>(buf1);

invalid static_cast from type 'uint8_t* {aka unsigned char*}' to type 'const signed char*'

c-style-cast: (const signed char*) works fine

Is there any danger using c-style-cast vs static_cast in this case?

Aucun commentaire:

Enregistrer un commentaire