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

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