unsigned char array[20] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4};
short (*p)[2];
p = static_cast<short (*)[2]>((void*)array) ;
for(int i=0; i<3; i++){
for(int j=0; j<2; j++){
qDebug() << p[i][j];
}
}
c语言中指针类型转换
最新推荐文章于 2023-01-08 00:05:38 发布