This is my function
int mkvCopyWord(uint8_t *pBuffer, UINT8 temp):
main()
{
uint8_t a[10];
mkvCopyWord(&a,10);
}
its says warning : note: expected ‘uint8_t *’ but argument is of type ‘uint8_t (*)[10]’
how to remove this warning..?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your syntax for passing a pointer-to-array is fine. But you are trying to pass it to something that doesn’t want a pointer-to-array. It just wants a pointer to the beginning element. The simplest way to get that is to allow the array name to decay to a pointer, thus
mkvCopyWord(a, 10). The function will assume that the pointer you give it is pointing to some sequence ofuint8_ts somewhere – that is why you have to pass the array size as another parameter, because it does not know about the array, it only has some address in memory where the array is.