3.3 String and Argument-List Functions

The DEC C RTL contains a group of functions that manipulate strings. Some of these functions concatenate strings; others search a string for specific characters or perform some other comparison, such as determining the equality of two strings.

The DEC C RTL also contains a set of functions that allow you to copy buffers containing binary data.

The set of functions defined and declared in the <varargs.h> and the <stdarg.h> header files provide a method of accessing variable- length argument lists. The <stdarg.h> functions are defined by the ANSI C Standard and are more portable than those defined in <varargs.h>.

The RTL functions such as printf and execl, for example, use variable-length argument lists. User- defined functions with variable-length argument lists that do not use <varargs.h> or <stdarg.h> are not portable due to the different argument-passing conventions of various machines.

The <stdarg.h> header file does not contain va_alist and va_dcl. The following shows a syntax example when using <stdarg.h>:

function_name(int arg1, ...)
{
   va_list ap;
      .
      .
      .

When using <varargs.h>:

These names and declarations have the following syntax:

function_name(va_alist)
va_dcl
{
   va_list ap;
      .
      .
      .


Previous Page | Next Page | Table of Contents | Index