mardi 21 juillet 2015

Initialiser list passed as function parameter for array

How do I make this work:

void foo(uint8_t a[]) { ... }

foo({0x01, 0x02, 0x03});

It gives me an error:

error: cannot convert '<brace-enclosed initializer list>' to 'uint8_t* {aka unsigned char*}' for argument '1'
                                                     ^

Aucun commentaire:

Enregistrer un commentaire