# CopyStream

Creates a copy of a random stream.

## Syntax

Fortran:

status = vslcopystream( newstream, srcstream )

C:

status = vslCopyStream( &newstream, srcstream );

## Description

The function creates an exact copy of srcstream and stores its descriptor to newstream.

## Input Parameters

Name | Type | Description
--- | --- | ---
srcstream | FORTRAN: TYPE(VSL_STREAM_STATE), INTENT(IN) C: VSLStreamStatePtr | FORTRAN: Descriptor of the stream to be copied C: Pointer to the stream state structure to be copied

## Output Parameters

Name | Type | Description
--- | --- | ---
newstream | FORTRAN: TYPE(VSL_STREAM_STATE), INTENT(OUT) C: VSLStreamStatePtr* | Copied stream descriptor

## Return Values

VSL_ERROR_OK, VSL_STATUS_OK
  Indicates no error, execution is successful.
VSL_ERROR_NULL_PTR
  srcstream parameter is a NULL pointer.
VSL_ERROR_BAD_STREAM

  srcstream is not a valid random stream.

VSL_ERROR_MEM_FAILURE

  System cannot allocate memory for newstream.

Parent topic: Service Routines