C API Reference -- Ns_SetCopy

### Ns_SetCopy

#### Overview

Create a new copy of a set

#### Syntax

        Ns_Set *Ns_SetCopy(
        Ns_Set *old
        );

#### Description

This function returns a newly allocated set that contains the same fields as the original set. The two sets share no memory and can be freed individually.

#### Examples

        Ns_Set *setA;
        Ns_Set *setB;

        setA = Ns_SetCreate("setA");
        Ns_SetPut(setA, "foo", "foovalue");
        setB = Ns_SetCopy(setA);
        Ns_SetFree(setA);
        /* do something with setB */
        Ns_SetFree(setB);

Top of Page
Copyright © 1998-99 America Online, Inc.