can you please explain how to use int array in typedef struct?
In my header i have code:
typedef struct {
int arr[20];
int id;
} Test;
In some function (where i include my header file) i use:
Test tmp = malloc(sizeof(Test));
tmp.id = 1;
//and how to use array arr?
//for example I want add to array -1
Thank you for your reply.
tmp.arr[0] = -1? You would have to keep track of the last index as you can't "add" stuff to arrays. Their size is fixed (unless you userealloc)