Thread View: csu.cs.200
3 messages
3 total messages
Started by Melissa Jackson
Tue, 15 Sep 1998 00:00
Assignment #2 Structures Question
Author: Melissa Jackson
Date: Tue, 15 Sep 1998 00:00
Date: Tue, 15 Sep 1998 00:00
6 lines
734 bytes
734 bytes
How is anyone dealing with two linked lists with diffrent data? How did anyone declare structures? Did you inclusde name, age , and alary in one structure? Or create different stuctures for each linked list? thanks melissa
Re: Assignment #2 Structures Question
Author: Michael Szczepaniak
Date: Tue, 15 Sep 1998 00:00
Date: Tue, 15 Sep 1998 00:00
17 lines
1149 bytes
1149 bytes
Since age and salary are can be declared as int's, I used the following
struct to create both lists (and it works ;-) :
struct SLLnode{
char lname[MAXLAST]; // where MAXLAST is a declared const
int age_sal;
SLLnode *next;
};
Melissa Jackson wrote:
> How is anyone dealing with two linked lists with diffrent data? How did
> anyone declare structures? Did you inclusde name, age , and alary in
> one structure? Or create different stuctures for each linked list?
>
> thanks
> melissa
Re: Assignment #2 Structures Question
Author: Adam Carheden
Date: Wed, 16 Sep 1998 00:00
Date: Wed, 16 Sep 1998 00:00
9 lines
1028 bytes
1028 bytes
I have a two structs. The first is called SLLnode and contains a character array (for the name) and an integer (which doubles as either age or salary). The second is called SLL and contains SLLnode data and SLL *next. Both lists are the same, but in one the SLL.data.age_salary field is interpreted as an age, and as a salary in the other. -- Adam carheden@holly.colostate.edu http://holly.ColoState.edu/~carheden
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads