Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
void GetKey(int date, unsigned char[] key) { }
我正在尝试传递 unsigned char 数组 ta 函数,但在“key”变量所在的位置出现错误“expected a ')'”。
只需移动括号:
void GetKey(int date, unsigned char key[])
但请注意,它本质上会退化为指针。
使用模板函数:
template<size_t N> void GetKey(int date, unsigned char(&key)[N]) { }