atoh()

Convert a string containing a hexadecimal number into an unsigned number

Synopsis:

#include <stdlib.h>

unsigned atoh( const char* ptr );

Since:

BlackBerry 10.0.0

Arguments:

ptr
A pointer to the string to parse.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The atoh() function converts the string pointed to by ptr to unsigned representation, assuming the string contains a hexadecimal (base 16) number.

Returns:

The converted value.

Examples:

#include <stdlib.h>
#include <stdio.h>

int main( void )
  {
    unsigned x;

    x = atoh( "F1A6" );
    printf( "number is %x\n", x );
    return EXIT_SUCCESS;
  }

Classification:

QNX 4

Safety:  
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus