tn = tpl_map("S(ci)#", sa, 100); /* fixed-length array of 100 structures */ -tn = tpl_map("A(S(ci))", &one); /* variable-length array (one at a time)*/+tn = tpl_map("A(S(ci))", &one); /* variable-length array (one at a time) */
diff --git a/doc/userguide.html b/doc/userguide.html index 651352c..073f4ed 100644 --- a/doc/userguide.html +++ b/doc/userguide.html @@ -1332,7 +1332,7 @@ int main() { tpl_load(tn, TPL_FILE, "/tmp/fixed.tpl"); tpl_unpack(tn,0); /* unpack all 10 elements at once */ tpl_free(tn); - /* now do something with x[0]...x[9].. (not shown */ + /* now do something with x[0]...x[9].. (not shown) */ }
For completeness, let’s also see how to unpack a variable-length integer array.
tn = tpl_map("S(ci)#", sa, 100); /* fixed-length array of 100 structures */ -tn = tpl_map("A(S(ci))", &one); /* variable-length array (one at a time)*/+tn = tpl_map("A(S(ci))", &one); /* variable-length array (one at a time) */
The differences between fixed- and variable-length arrays are explained in the Arrays section.
/* add some elements to list.. (not shown)*/+
/* add some elements to list.. (not shown) */