how the data structure is used in c language
c program
Collapse
This topic is closed.
X
X
-
Tags: None
-
A struct is the only way in C to group your data items together.
If you have a mailing list application, you might have a struct that groups the person's name, address, city, state and zip data items. Then you create variables of the struct.
This is much easier than using arrays of names plus arrays of addresses plus arrays of cities plsu arrays of states plus arrays of zip codes and then try to keep this all straight as you add and delete people from the mailing list.Comment
-
Are you looking for how to use struct in C language or you asked something related to Data Structure like Stack, Queue and Linked Lists etc. FYI...you can use arrays for implementing Stack and Queues data structures and Struct for implementing Linked Lists respectively.Comment
-
Comment
-
It might help you in understanding these stuffs.
Comment
-
Oh .. so when you referred to "data structure" in your original post you weren't asking about the struct keyword in general, you want know how to set up a structure that is suitable for use in a singly and/or a doubly linked list.
Is that right?
Is this a different question than Linked lists and arrays or do you want to retire one of these threads?Comment
-
I guess the OP wants to know things about linked lists and/or arrays; we got one step further than 'the structure'; I'll close this thread and we continue this tiresome story in the other thread.Oh .. so when you referred to "data structure" in your original post you weren't asking about the struct keyword in general, you want know how to set up a structure that is suitable for use in a singly and/or a doubly linked list.
Is that right?
Is this a different question than Linked lists and arrays or do you want to retire one of these threads?
kind regards,
JosComment
Comment