12 Replies - 1536 Views - Last Post: 01 October 2007 - 09:34 PM Rate Topic: -----

#1 marckiestar   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 21
  • Joined: 21-August 07

Linked List Question!

Post icon  Posted 01 October 2007 - 07:34 PM

Hi! its my first time to use linked list...... all I know is to store one value in each node. But is it possible to store multiple values in each node of a linked list.

For example : Node a has the following data: (1) Name (2) address (3) Tel. #.
could you show some code on how to implement this?

It's urgent... I need this info asap.
Is This A Good Question/Topic? 0
  • +

Replies To: Linked List Question!

#2 nirvanarupali   User is offline

  • D.I.C Stomach
  • member icon

Reputation: 14
  • View blog
  • Posts: 1,120
  • Joined: 01-August 07

Re: Linked List Question!

Posted 01 October 2007 - 07:42 PM

Hello marckiestar, read the rules first. You must exert some effort to write your codes, then post here together with your problems which you encountered. There are many people who are willing to help you. :)
Was This Post Helpful? 0
  • +
  • -

#3 born2c0de   User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 187
  • View blog
  • Posts: 4,673
  • Joined: 26-November 04

Re: Linked List Question!

Posted 01 October 2007 - 07:50 PM

Quote

But is it possible to store multiple values in each node of a linked list.

Yes, it is.
Simply create your node structure like this:
struct node
{
   int data1;
   char data2;
   /* ... */
   float dataN;
   struct node *next;
};


You can also read this Data Structures Tutorial to learn how a Linked List works.
Was This Post Helpful? 0
  • +
  • -

#4 nirvanarupali   User is offline

  • D.I.C Stomach
  • member icon

Reputation: 14
  • View blog
  • Posts: 1,120
  • Joined: 01-August 07

Re: Linked List Question!

Posted 01 October 2007 - 07:59 PM

Linked List Implementation here
Was This Post Helpful? 0
  • +
  • -

#5 ajaymatrix   User is offline

  • D.I.C Regular
  • member icon

Reputation: 1
  • View blog
  • Posts: 410
  • Joined: 15-May 07

Re: Linked List Question!

Posted 01 October 2007 - 08:03 PM

that tutorial helps a lot..
Was This Post Helpful? 0
  • +
  • -

#6 nirvanarupali   User is offline

  • D.I.C Stomach
  • member icon

Reputation: 14
  • View blog
  • Posts: 1,120
  • Joined: 01-August 07

Re: Linked List Question!

Posted 01 October 2007 - 08:05 PM

:^:
Was This Post Helpful? 0
  • +
  • -

#7 marckiestar   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 21
  • Joined: 21-August 07

Re: Linked List Question!

Posted 01 October 2007 - 08:45 PM

Hi everyone!
Thank You for your reply........ But its really difficult ot understand the tutorials.....we are using borland c++ 1991 and it doesn't use using namespace and whatsoever...... could you translate the tutorial using the header files conio.h, iostrem.h, stdlib.h, stdio.h?

thank you for your reply.......
Was This Post Helpful? 0
  • +
  • -

#8 nirvanarupali   User is offline

  • D.I.C Stomach
  • member icon

Reputation: 14
  • View blog
  • Posts: 1,120
  • Joined: 01-August 07

Re: Linked List Question!

Posted 01 October 2007 - 08:57 PM

Download the latest version of Borland. I am using Borland 5.5 and it supports the latest ISO.

Linked List Implementation is Intermediate,I guess. One way of learning is reading the tutorial. :)
Was This Post Helpful? 0
  • +
  • -

#9 marckiestar   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 21
  • Joined: 21-August 07

Re: Linked List Question!

Posted 01 October 2007 - 08:57 PM

born2c0de are you saying that you declare all the possible content of the node inside the struct on the top, then when you enter the values, it may look like this?
int x;
char y;
when inputting content of the node:
p->next->x=123;
p->next->y=h;

could p->next appear at the same time?
Was This Post Helpful? 0
  • +
  • -

#10 marckiestar   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 21
  • Joined: 21-August 07

Re: Linked List Question!

Posted 01 October 2007 - 09:06 PM

nirvanarupali the compiler we are using at school is borland c++ 1991 and we could not modify that


nirvanarupali taga philippines ka din pala..... taga san ka....alam mo magtagalog?
Was This Post Helpful? 0
  • +
  • -

#11 nirvanarupali   User is offline

  • D.I.C Stomach
  • member icon

Reputation: 14
  • View blog
  • Posts: 1,120
  • Joined: 01-August 07

Re: Linked List Question!

Posted 01 October 2007 - 09:19 PM

Cebu City. We can't speak our language here. Avoid that, we are composed of international members here.

Try to convinced you school professor or administrator to change your old compiler, it would be a big mess if you are studying C++, the old way, I mean not in ISO. You are not in the right track.

Try the link which I give above. I learned a lot from that.
Was This Post Helpful? 0
  • +
  • -

#12 marckiestar   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 21
  • Joined: 21-August 07

Re: Linked List Question!

Posted 01 October 2007 - 09:23 PM

nirvanarupali can you give me a sample code the one that is easy to understand... a code in your own way....just a bit.....please... im just a beginner....by the way how old r u? Im just 17
Was This Post Helpful? 0
  • +
  • -

#13 nirvanarupali   User is offline

  • D.I.C Stomach
  • member icon

Reputation: 14
  • View blog
  • Posts: 1,120
  • Joined: 01-August 07

Re: Linked List Question!

Posted 01 October 2007 - 09:34 PM

View Postmarckiestar, on 1 Oct, 2007 - 09:23 PM, said:

nirvanarupali can you give me a sample code the one that is easy to understand... a code in your own way....just a bit.....please... im just a beginner....by the way how old r u? Im just 17



No. just pm me, if you got more that 10 post.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1