atol or atoll Subroutine

Purpose

Converts a string to a long integer.

Syntax

#include <stdlib.h>

long long atoll (nptr)
const char *nptr;

long atol (nptr)
const char *nptr;

Description

The atoll and atol subroutines (str) are equivalent to strtoll(nptr, (char **)NULL, 10) and strtol(nptr, (char **)NULL, 10), respectively. If the value cannot be represented, the behavior is undefined.

Parameters

Item Description
nptr Points to the string to be converted into a long integer.

Return Values

The atoll and atol subroutines return the converted value if the value can be represented.