By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,137 Members | 1,024 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,137 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jan 3 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Jan 3, 8:29 am, "Skyer" <q...@o2.plwrote:
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.

--
Pierre

Jan 3 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.