2

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?

1 Answer 1

3
typedef struct image Stream[NR_FRAMES];
Stream streams[NR_STREAMS];

or simply :

struct image streams[NR_STREAMS][NR_FRAMES]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.