Question

void GetKey(int date, unsigned char[] key)
{

}

I am trying to pass unsigned char array t a function but I get an error "expected a ')'" where "key" variable is.

Était-ce utile?

La solution

Just move the brackets:

void GetKey(int date, unsigned char key[])

But note that it'll essentially degenerate into a pointer.

Autres conseils

Use template function:

template<size_t N>
void GetKey(int date, unsigned char(&key)[N])
{
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top