---
name: "atou16"
section: "3abz"
platform: "linux"
package: "libabz0-dev"
version: "0.5.1"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/atou16"
---

# atou16(3abz)

convert a string to a 16-bit unsigned integer.

## NAME

atou16 - convert a string to a 16-bit unsigned integer.

## LIBRARIES

Abz Library (-labz), Debug Library (-ldebug)

## SYNOPSIS

```
#include <abz/atou16.h>

int atou16(const char *str, uint16_t *value);
```

## DESCRIPTION

The **atou16()** function converts a string to a 16-bit unsigned integer.

## RETURN VALUE

The **atou16()** function returns 0 if successful or -1 if the string is not a valid 16-bit unsigned integer.

Check *errno* to see what error occurred.

## NOTES

None of the libabz routines are thread-safe. I'm not planning to change this either! For more information, please see http://threading.2038bug.com/

Please note that **atou16()** automatically converts octal (preceded by 0) and hexadecimal (preceded by 0x) numbers, so 077 is not 77, but rather 63.

## AUTHOR

Written by Abraham vd Merwe \<abz@blio.com\>
