Visit Our UNIX and Linux User Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #959
Difficulty: Medium
The first virus attack against a Linux machine was by a virus called Stooge,
True or False?
Linux & Unix Commands - Search Man Pages

atoi(3) [freebsd man page]

ATOI(3) 						   BSD Library Functions Manual 						   ATOI(3)

atoi -- convert ASCII string to integer LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdlib.h> int atoi(const char *nptr); DESCRIPTION
The atoi() function converts the initial portion of the string pointed to by nptr to int representation. It is equivalent to: (int)strtol(nptr, (char **)NULL, 10); The atoi() function has been deprecated by strtol() and should not be used in new code. ERRORS
The function atoi() need not affect the value of errno on an error. SEE ALSO
atof(3), atol(3), strtod(3), strtol(3), strtoul(3) STANDARDS
The atoi() function conforms to ISO/IEC 9945-1:1990 (``POSIX.1''), ISO/IEC 9899:1990 (``ISO C90''), and ISO/IEC 9899:1999 (``ISO C99''). BSD
June 4, 1993 BSD

Check Out this Related Man Page

ATOL(3) 						   BSD Library Functions Manual 						   ATOL(3)

atol, atoll -- convert ASCII string to long or long long integer LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdlib.h> long atol(const char *nptr); long long atoll(const char *nptr); DESCRIPTION
The atol() function converts the initial portion of the string pointed to by nptr to long integer representation. It is equivalent to: strtol(nptr, (char **)NULL, 10); The atoll() function converts the initial portion of the string pointed to by nptr to long long integer representation. It is equivalent to: strtoll(nptr, (char **)NULL, 10); COMPATIBILITY
The FreeBSD implementations of the atol() and atoll() functions are thin wrappers around strtol() and strtoll() respectively, so these func- tions will affect the value of errno in the same way that the strtol() and strtoll() functions are able to. This behavior of atol() and atoll() is not required by ISO/IEC 9899:1990 (``ISO C90'') or ISO/IEC 9899:1999 (``ISO C99''), but it is allowed by all of ISO/IEC 9899:1990 (``ISO C90''), ISO/IEC 9899:1999 (``ISO C99'') and IEEE Std 1003.1-2001 (``POSIX.1''). ERRORS
The functions atol() and atoll() may affect the value of errno on an error. SEE ALSO
atof(3), atoi(3), strtod(3), strtol(3), strtoul(3) STANDARDS
The atol() function conforms to ISO/IEC 9899:1990 (``ISO C90''). The atoll() function conforms to ISO/IEC 9899:1999 (``ISO C99''). BSD
May 14, 2013 BSD

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

applicatoin cannot started, becos daemon did not run

hi, i had an applicatoin which is not running cos one of its daemon is not running.. i get the applicatoin to run by running the daemon first... its manual job... so quite cumbersome.. i have backups in the night, with the crontab -l entry with logs written. the logs indicated successful... (7 Replies)
Discussion started by: yls177
7 Replies

2. Programming


i know what is the use of atoi function.... converts string to int. but whenever i use that it gives me 0.... could any one help in this issue.. eg. int i; char str; str="name"; i=atoi(str); i gives me 0. why? (3 Replies)
Discussion started by: bankpro
3 Replies

3. Shell Programming and Scripting

Dynamic Log Deletion/Rotatoin Script

I've written a small static script for my log deletion, but I was wondering if there was a way to make it a dynamic script. here is how my script currently works. #!/bin/sh ########################################### #Script to zip logs older than 1 week old #and to delete logs older than 30... (3 Replies)
Discussion started by: cbo0485
3 Replies

4. Programming

why the implementatoin of Bakery algorithm in ANSI C does not work in ANSI C

I follow the description of wiki (Lamport's bakery algorithm - Wikipedia, the free encyclopedia), then implement that algorithm in C, but it doesn't work, Starving is still here, is the implementation worry? Only print out: Thread ID: 0 START! Thread ID: 0 END! Thread ID: 0 START!... (2 Replies)
Discussion started by: sehang
2 Replies

5. Programming

help with atoi and macros in C

I have a PORT_NUM macro (10 digits long number) in a server file, if i do htons(PORT_NUM) i get warning: this decimal constant is unsigned only in ISO C90 warning: large integer implicitly truncated to unsigned type whats wrong with this? (2 Replies)
Discussion started by: omega666
2 Replies

6. Programming

type conversion C, atoi()

In the book "The C programming language"; second edition, chapter 2.7 there is a snippet which is supposed to: "convert a string of digits into its numeric equivalent". int atoi(char s) { int i, n; n = 0; for ( i = 0; s >= '0' && s <= '9'; ++i) n = 10 * n + (s -... (4 Replies)
Discussion started by: tornow
4 Replies

7. Red Hat

Cant Access Applicatoin GUI Remotely (SSH)

Greetings! Theres an application in my RHEL 6 server that has a GUI (which we'd like to use). When I run the is says it needs Server X11. I know its gotta do something with X server (and I installed it).I found some tutorial for auto configuration and then I was supposed to access... (0 Replies)
Discussion started by: RedSpyder
0 Replies

8. Solaris

Network interface showing wrong configuratoin

on both of my T2000 I am seeing same values of 100Mbps for e1000g0 ethernet port. i know all four ethernet ports on T2000 are gigabit ports so why is my first link showing as 100Mbps and how can i correct it? # dladm show-dev e1000g0 link: up speed: 100 Mbps ... (1 Reply)
Discussion started by: aliyesami
1 Replies

Featured Tech Videos