summaryrefslogtreecommitdiffstats
path: root/runtime/docs/examples/list.c
blob: 15d13d4bed47a34513078c769e6d769bb16093a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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);