cn_map / cn_map_size
Syntax
CNM_UINT cn_map_size(CN_MAP map)
Description
Tells the number of nodes in the CN_Map
map.
Return Value
Returns an unsigned integer (typedef'd as cnm_uint).
Examples
Basic Usage
#include <stdio.h>
#include <stdlib.h>
#include "cn_cmp.h"
#include "cn_map.h"
main() {
CN_MAP map = cn_map_init(int, int, cn_cmp_int);
int key = 0;
int value = 0;
//Insert quite a few elements
for (; key < 1000; key++) {
cn_map_insert(map, &key, &value);
}
printf("Size: %d\n", cn_map_size(map));
cn_map_free(map);
}