# NAG CL Interfacex04ncc

## 1Purpose

x04ncc takes, as a string argument, the name of a NAG error (e.g., NE_BAD_PARAM) and returns, as an int, the corresponding fail code for the given NAG error.

## 2Specification

 #include
 int x04ncc (const char *error_name)
The function may be called by the names: x04ncc or nag_error_name_to_code.

## 3Description

x04ncc takes, as a string argument, the name of a NAG error (e.g., NE_BAD_PARAM) and returns, as an int, the corresponding fail code for the given NAG error. If the input string does not correspond to a NAG error name then the function returns $-1$.
Converting the error name to int may be useful when the NAG Header Files are not available, but the int value of an error name is required, say, for checking fail.code following a call to a NAG function.

None.

## 5Arguments

1: $\mathbf{error_name}$const char * Input
On entry: the value of a NAG enumeration member.

## 6Error Indicators and Warnings

If the value $-1$ is returned then the input value is not recognized as a valid NAG fail code.

Not applicable.

## 8Parallelism and Performance

x04ncc is not threaded in any implementation.

None.

## 10Example

This example produces integer error codes corresponding to a number of error code names.

### 10.1Program Text

Program Text (x04ncce.c)

None.

### 10.3Program Results

Program Results (x04ncce.r)