Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

C/C++ API Documentation | 2026.1

# StrOps::XtoO( char *, unsigned char *, int )

Convert a hex string into an octet stream.

Virtual? | No |
Class | `StrOps` |
Arguments | `char *x` | the input hex string
| `char *octet` | the output stream
| `int octlen` | the length of the output, in bytes
Returns | `void` |

## Notes

This function converts the input hexadecimal string into the stream of bytes that it represents.

## Example

Copy

    char *hex = "666F6F";
    unsigned char oct[4];

    StrOps::XtoO( hex, oct, 3 );
    oct[3] = '\0';

    printf( "%s", oct );

    return 0;

Executing the preceding code produces the following output:

    % a.out
    foo

Your search for returned results