array[x][y] with dynamic elements struct as list

S

Skyer

How to write?

I have write program in C language. This program contain 1 array[20][20]
with struct. Every element of table must be dynamic list LIFO (stack).
Adding and removing struct variable from list array[x][y].
My question: How to declare this table?
How to begining, any ideas?

struct list {
int *type;
struct list *next_elem;
}element;

Example:
I add new element to array[20][1]
next i adding next elemtent do array[20][[1]
A remove first from array[20][1] - LIFO
 
P

Pierre Lombard

How to write?

I have write program in C language. This program contain 1 array[20][20]
with struct. Every element of table must be dynamic list LIFO (stack).
Adding and removing struct variable from list array[x][y].
My question: How to declare this table?
How to begining, any ideas?

struct list {
int *type;
struct list *next_elem;

}element;Example:
I add new element to array[20][1]
next i adding next elemtent do array[20][[1]
A remove first from array[20][1] - LIFO

If I understand your question, I'd say:
struct list * array[20][20];

Note that if you use a array whose size is 20, it goes from 0 to 19 in
C.
Hence, do not use array[20][1] for instance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top