- // adf.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- typedef unsigned short uint16;
- struct video_struct{
- int frames, rows, cols, bits_per_component, mode;
- uint16*** data[5];
- };
- int _tmain(int argc, _TCHAR* argv[])
- {
- video_struct _v1;
- for(int i = 0; i < 5; i++)
- {
- _v1.data[i]= (uint16***)malloc(sizeof(uint16)*3);
- for(int j = 0; j < 3; j++)
- {
- ((_v1.data[i]))[j]= (uint16**)malloc(sizeof(uint16)*3);
- for(int x = 0; x < 3; x++)
- {
- ((_v1.data[i][j]))[x] = (uint16*)malloc(sizeof(uint16)*3);
- }
- }
- }
- for(int x1 = 0; x1 < 5; x1++)
- {
- for(int x2 = 0; x2 < 3; x2++)
- {
- for(int x3 = 0; x3 < 3; x3++)
- {
- (*(_v1.data[x1][x2]))[x3] = x1+x2+x3;
- }
- }
- }
- _v1.frames = 1;
- _v1.rows = 1;
- _v1.cols = 1;
- _v1.bits_per_component = 1;
- _v1.mode = 1;
- uint16 cds = _v1.data[0][0][0][2];
- return 0;
- }
- //该片段来自于http://www.codesnippet.cn/detail/151120137193.html
来源: http://www.codesnippet.cn/detail/151120137193.html