Question, how would you write a program to meet the following requirements?
Ref Title Cost --- ----- ---- 1234 Oracle_Guide 22.95
	main()
 	{
	  char array[50][80]; /* 50 records, 80 bytes long	*/
	}
The data can then be read into the array and then actions performed 
on the data.
This is OK but has some major problems.
 
The concept of a linked list is fairly simple. It is a group of structures
linked together by pointers, here is a picture: 
 
 
The "Name Age Pointer" block could be defined as below:
 
	struct record {char name[20]; int age; struct record *next_rec;}; 
The important bit is "struct record *next_rec" this is the pointer to the next
structure (record). It will either point to the next record which 
will require memory reserved 
with the malloc function or
NULL if  its the last record.
 Here is the first example. 
This program is more complicated than I would 
like, but its the simplest I can come up with.
 Here is the first example. 
This program is more complicated than I would 
like, but its the simplest I can come up with. 
 This is the same program but without the heavy commenting.
This is the same program but without the heavy commenting.
 This is still the same program but it is slightly simplified with the use 
of typedef.
This is still the same program but it is slightly simplified with the use 
of typedef.
| Top | Master Index | C Keywords | Functions |