.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Mon Mar 29 22:39:41 1993, David Metcalfe .\" Modified Sat Jul 24 21:38:42 1993, Rik Faith (faith@cs.unc.edu) .\" Modified Sun Dec 17 18:35:06 2000, Joseph S. Myers .\" Переведен на русский Fri 22 Sep 2000 11:26:59, Alexey V. Medvedev 2:5022/78.6 .TH ATOI 3 "17 декабря 2000" "GNU" "Linux Programmer's Manual" .SH ИМЯ atoi, atol, atoll, atoq \- преобразует строку символов в целое число .SH СИНТАКСИС .nf .B #include .sp .BI "int atoi(const char *" nptr ); .br .BI "long atol(const char *" nptr ); .br .BI "long long atoll(const char *" nptr ); .br .BI "long long atoq(const char *" nptr ); .fi .SH ОПИСАНИЕ Функция .B atoi() преобразует начальную часть строки, на которую указывает .IR nptr , в целое число типа int. Действие аналогично .sp .RS .B strtol(nptr, (char **)NULL, 10); .RE .sp за исключением того, что \fBatoi()\fP не сообщает об ошибках. .PP Функции .B atol() и .B atoll() ведут себя так же, как и .BR atoi() , но только преобразуют начальную часть строки в значение типа .I long или .IR "long long" . .BR atoq() " --" это устаревшее название функции .BR atoll() . .SH "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ" Преобразованное число. .SH "СООТВЕТСТВИЕ СТАНДАРТАМ" SVID 3, POSIX.1, BSD 4.3, ISO/IEC 9899. ISO/IEC 9899:1990 (C89) и POSIX.1 (редакция 1996 года) включают только функции .B atoi() и .BR atol() ; C99 добавляет функцию .B atoll() . .SH "ЗАМЕЧАНИЯ" Нестандартная .B atoq() не содержится в libc 4.6.27 и glibc2, но присутствует в libc5 и libc 4.7 (но, вплоть до libc 5.4.44, только в виде inline-функции в .BR ). Функция .B atoll() присутствует в glibc 2 с версии 2.0.2, но не в libc4 или libc5. .SH "СМОТРИ ТАКЖЕ" .BR atof "(3), " .BR strtod "(3), " .BR strtol "(3), " .BR strtoul (3)