typedef struct image Stream[NR_FRAMES];
Stream streams[NR_STREAMS];
or simply :
struct image streams[NR_STREAMS][NR_FRAMES]
문제
I defined a data structure as follows:
struct image{
unsigned int width, height;
unsigned char *data;
};
An array of structures as defined above would be something like:
struct image input[NR_FRAMES];
If I would like another array, let's say streams
, that has as elements streams[i]
arrays of structures as defined above, how would I declare it?
해결책
typedef struct image Stream[NR_FRAMES];
Stream streams[NR_STREAMS];
or simply :
struct image streams[NR_STREAMS][NR_FRAMES]