tgrekov-pipex
HIVE pipex May 2024
Loading...
Searching...
No Matches
ft_atoi.c File Reference

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_atoi.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/25 13:12:00 by tgrekov #+# #+# */
/* Updated: 2023/11/16 08:55:47 by tgrekov ### ########.fr */
/* */
/* ************************************************************************** */

Definition in file ft_atoi.c.

#include "libft.h"
Include dependency graph for ft_atoi.c:

Go to the source code of this file.

Functions

int ft_atoi (const char *str)
 Converts ASCII string str to integer representation.
 

Function Documentation

◆ ft_atoi()

int ft_atoi ( const char *  str)

Converts ASCII string str to integer representation.

Converts the initial numerical portion of the string at pointer str to int representation.

Numerical portion may be preceded by a singular optional + or - sign.

Parameters
[in]strNull-terminated string containing integer
Return values
intResult of conversion, unless the value (handled as a long during conversion), would overflow or underflow, in which case it returns FT_LONG_MAX or FT_LONG_MAX - 1, respectively.

Definition at line 42 of file ft_atoi.c.

References ft_isdigit(), and FT_LONG_MAX.

Here is the call graph for this function:
Here is the caller graph for this function: