Digital Stronghold - Software Engineering Blog




November 27, 2005

List application

Filed under: Progressive Studies

To illustrate the use of those functions, here is an example.

#include <stdio.h>
#include <stdlib.h>
#include "list.h"
	
LINK string_to_list(char []);
void print_list(LINK);
int count_rec(LINK);
	
int main(void)
{
        LINK h;
	
        h = string_to_list("ABC");
        printf("The resulting list is\n");
        print_list(h);
        printf("\nThis list has %d elements.\n", count_rec(h));
        return 0;
}

The output of the program is

The resulting list is
A --> B --> C --> NULL
This list has 3 elements.

1 Comment »

The URI to TrackBack this entry is: http://eradicus.blogsome.com/2005/11/27/list-application/trackback/

  1. h = string_to_list(”GRAI…”); :p

    Comment by amerei — December 2, 2005 @ 12:52 am

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Theme designed by Joset Anthony Zamora


Digital Stronghold

↑ Get Headline Animator