指针数组学习
Posted hjj-fighting
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了指针数组学习相关的知识,希望对你有一定的参考价值。
int Rawdata_PreProcess(const void **in_frame, int n, int frame_size, void *out_frame) { const short **iframe = (const short **)in_frame; short *oframe = (short *)out_frame; int member = frame_size / sizeof(short); for (int m = 0; m < member; m++) { int sum = 0; for(int i = 0; i < n; i++) { short point = iframe[i][m]; printf("frame:%d, index:%d, value:%d\n", i, m, (int)point); sum += point; } oframe[m] = sum / n; } return 0; } short frame1[4] = {1, 4, 6, 7}; short frame2[4] = {3, 6, 2, 9}; short frame3[4] = {1, 5, 3, 4}; short out[4]; int main(void) { short *group[3] = {frame1, frame2, frame3}; Rawdata_PreProcess(group, 3, 8, out); printf("a:%d, b:%d, c:%d, d:%d\n", out[0], out[1], out[2], out[3]); }
以上是关于指针数组学习的主要内容,如果未能解决你的问题,请参考以下文章