ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

Can you implement the code for a linked list data structure in C language?

user-image
تم إضافة السؤال من قبل himanshu mittal
تاريخ النشر: 2013/07/03
Athanassios Staveris-Polykalas
من قبل Athanassios Staveris-Polykalas , Secretary General of Telecommunications and Post - Hellenic Republic , General Secretariat of Telecommunications and Post - Hellenic Republic

yes, using dynamic memory allocation and pointers.
first you create a struct like: struct list_el { int value; struct list_el *next; } typedef struct list_el item; inside your main now: main () { item * curr, *head; int i; head=NULL; for (i=1;ivalue=i; curr->next=head; head=curr; } curr=head; //then you can print your list // while(curr){ printf("%d\n\t",curr->value_; curr=curr->next; } } hope this helps

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟