From e32551b18f4560056d2d482f5e1505b1b98fa82a Mon Sep 17 00:00:00 2001 From: hunt Date: Tue, 29 Mar 2005 18:07:58 +0000 Subject: *** empty log message *** --- runtime/docs/examples/list.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 runtime/docs/examples/list.c (limited to 'runtime/docs/examples/list.c') diff --git a/runtime/docs/examples/list.c b/runtime/docs/examples/list.c new file mode 100644 index 00000000..15d13d4b --- /dev/null +++ b/runtime/docs/examples/list.c @@ -0,0 +1,14 @@ + +struct map_node_str *ptr; + +MAP map = _stp_list_new(10, STRING); + +for (i = 0; i < 10; i++) { + sprintf (buf, "Item%d", i); + _stp_list_add (map, buf); + } + +foreach (map, ptr) + printf ("map[%ld] = %s\n", key1int(ptr), ptr->str); + + -- cgit