The ifx_int8copy() function

The ifx_int8copy() function copies one int8 structure to another.

Syntax

void ifx_int8copy(source, target)
   ifx_int8_t *source;
   ifx_int8_t *target;
source
A pointer to the int8 structure that contains the source int8 value to copy.
target
A pointer to the target int8 structure.

The ifx_int8copy() function does not return a status value. To determine the success of the copy operation, look at the contents of the int8 structure to which the target argument points.

Example

The file int8copy.ec in the demo directory contains the following sample program.
/*
   * ifx_int8copy.ec *

   The following program copies one INT8 number to another.
*/

#include <stdio.h>

EXEC SQL include "int8.h";

char string1[] = "-12,888,999,555,333";
char result[41];

main()
{
    mint x;
    ifx_int8_t num1, num2;

    printf("IFX_INT8COPY Sample ESQL Program running.\n\n");

    printf("String = %s\n", string1);
    if (x = ifx_int8cvasc(string1, strlen(string1), &num1))
        {
        printf("Error %d in converting string1 to INT8\n", x);
        exit(1);
        }
    printf("Executing: ifx_int8copy(&num1, &num2)\n");
    ifx_int8copy(&num1, &num2);
    if (x = ifx_int8toasc(&num2, result, sizeof(result)))
        {
        printf("Error %d in converting num2 to string\n", x);
        exit(1);
        }
    result[40] = '\0';
    printf("Destination = %s\n", result);

    printf("\nIFX_INT8COPY Sample Program over.\n\n");
    exit(0);
}

Output

IFX_INT8COPY Sample ESQL Program running.

String = -12,888,999,555,333
Executing: ifx_int8copy(&num1, &num2)
Destination = -12888999555333

IFX_INT8COPY Sample Program over