CAPL Script

SnPrintf

Syntax

long snprintf(char dest[], long len, char format[], ...);

Function

This function corresponds to the C functionsprintf. Supplementally, the parameterlenindicates the maximum length of the arraydest. The format string has the same meaning as with the functionwriteand is described there.

Parameters

dest Character buffer to print to.

len

Maximum number of characters printed to buffer including terminating '\0'.Must be at most the size of the buffer.

format

Formatted string printed to buffer.

Return Values

The number of characters written.

char buffer[100], str[7] = "Vector";long i;i = snprintf(buffer,elcount(buffer),"String: %s\n", str);write("Output:\n%s : Character count = %d\n", buffer, i);

write | String Literal